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

[master] add zone memory context pools

3492.	[bug]		Fixed a regression in zone loading performance
			due to lock contention. [RT #30399]
This commit is contained in:
Evan Hunt
2013-02-20 21:39:05 -08:00
parent d642d38571
commit df925e6c66
30 changed files with 797 additions and 85 deletions

View File

@@ -67,7 +67,8 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) {
if (result != ISC_R_SUCCESS)
goto cleanup_lock;
keytable->mctx = mctx;
keytable->mctx = NULL;
isc_mem_attach(mctx, &keytable->mctx);
keytable->active_nodes = 0;
keytable->references = 1;
keytable->magic = KEYTABLE_MAGIC;
@@ -82,7 +83,7 @@ dns_keytable_create(isc_mem_t *mctx, dns_keytable_t **keytablep) {
dns_rbt_destroy(&keytable->table);
cleanup_keytable:
isc_mem_put(mctx, keytable, sizeof(*keytable));
isc_mem_putanddetach(&mctx, keytable, sizeof(*keytable));
return (result);
}
@@ -137,7 +138,8 @@ dns_keytable_detach(dns_keytable_t **keytablep) {
isc_rwlock_destroy(&keytable->rwlock);
DESTROYLOCK(&keytable->lock);
keytable->magic = 0;
isc_mem_put(keytable->mctx, keytable, sizeof(*keytable));
isc_mem_putanddetach(&keytable->mctx,
keytable, sizeof(*keytable));
}
*keytablep = NULL;