2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Add and use semantic patch to replace isc_mem_get/allocate+memset

Add new semantic patch to replace the straightfoward uses of:

  ptr = isc_mem_{get,allocate}(..., size);
  memset(ptr, 0, size);

with the new API call:

  ptr = isc_mem_{get,allocate}x(..., size, ISC_MEM_ZERO);
This commit is contained in:
Ondřej Surý
2022-06-03 12:36:24 +02:00
parent dbf5672f32
commit c1d26b53eb
40 changed files with 124 additions and 172 deletions

View File

@@ -407,8 +407,8 @@ isc_nm_listentcp(isc_nm_t *mgr, uint32_t workers, isc_sockaddr_t *iface,
sock->nchildren = (workers == ISC_NM_LISTEN_ALL) ? (uint32_t)mgr->nloops
: workers;
children_size = sock->nchildren * sizeof(sock->children[0]);
sock->children = isc_mem_get(worker->mctx, children_size);
memset(sock->children, 0, children_size);
sock->children = isc_mem_getx(worker->mctx, children_size,
ISC_MEM_ZERO);
isc_barrier_init(&sock->barrier, sock->nchildren);