mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 02:49:59 -04:00
Merge branch '3515-mctx-attach-detach-for-isc_mempool_t-v9_18' into 'v9_18'
[v9_18] Add mctx attach/detach when creating/destroying a memory pool See merge request isc-projects/bind9!6720
This commit is contained in:
commit
bf70a66ed8
2 changed files with 9 additions and 3 deletions
5
CHANGES
5
CHANGES
|
|
@ -1,3 +1,8 @@
|
|||
5953. [bug] Fix a crash on shutdown in delete_trace_entry(). Add
|
||||
mctx attach/detach pair to make sure that the memory
|
||||
context used by a memory pool is not destroyed before
|
||||
the memory pool itself. [GL #3515]
|
||||
|
||||
5952. [bug] Use quotes around address strings in YAML output.
|
||||
[GL #3511]
|
||||
|
||||
|
|
|
|||
|
|
@ -1183,8 +1183,6 @@ isc__mempool_create(isc_mem_t *restrict mctx, const size_t element_size,
|
|||
mpctx = isc_mem_get(mctx, sizeof(isc_mempool_t));
|
||||
|
||||
*mpctx = (isc_mempool_t){
|
||||
.magic = MEMPOOL_MAGIC,
|
||||
.mctx = mctx,
|
||||
.size = size,
|
||||
.freemax = 1,
|
||||
.fillcount = 1,
|
||||
|
|
@ -1197,6 +1195,9 @@ isc__mempool_create(isc_mem_t *restrict mctx, const size_t element_size,
|
|||
}
|
||||
#endif /* ISC_MEM_TRACKLINES */
|
||||
|
||||
isc_mem_attach(mctx, &mpctx->mctx);
|
||||
mpctx->magic = MEMPOOL_MAGIC;
|
||||
|
||||
*mpctxp = (isc_mempool_t *)mpctx;
|
||||
|
||||
MCTXLOCK(mctx);
|
||||
|
|
@ -1266,7 +1267,7 @@ isc__mempool_destroy(isc_mempool_t **restrict mpctxp FLARG) {
|
|||
|
||||
mpctx->magic = 0;
|
||||
|
||||
isc_mem_put(mpctx->mctx, mpctx, sizeof(isc_mempool_t));
|
||||
isc_mem_putanddetach(&mpctx->mctx, mpctx, sizeof(isc_mempool_t));
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
|||
Loading…
Reference in a new issue