From: Howard Chu Date: Thu, 1 Oct 2015 22:55:10 +0000 (+0100) Subject: ITS#8261 change sl_mem_detach to sl_mem_setctx X-Git-Tag: OPENLDAP_REL_ENG_2_4_43~41 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=411a14bddb6b442ed3edca1f26eba564145b9d0f;p=openldap ITS#8261 change sl_mem_detach to sl_mem_setctx --- diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 7c8bbf624d..9e96f9896c 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1839,7 +1839,7 @@ LDAP_SLAPD_V (BerMemoryFunctions) slap_sl_mfuncs; LDAP_SLAPD_F (void) slap_sl_mem_init LDAP_P(( void )); LDAP_SLAPD_F (void *) slap_sl_mem_create LDAP_P(( ber_len_t size, int stack, void *ctx, int flag )); -LDAP_SLAPD_F (void) slap_sl_mem_detach LDAP_P(( void *ctx, void *memctx )); +LDAP_SLAPD_F (void) slap_sl_mem_setctx LDAP_P(( void *ctx, void *memctx )); LDAP_SLAPD_F (void) slap_sl_mem_destroy LDAP_P(( void *key, void *data )); LDAP_SLAPD_F (void *) slap_sl_context LDAP_P(( void *ptr )); diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index d440acbf28..017e61301e 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -279,16 +279,17 @@ slap_sl_mem_create( } /* - * Separate memory context from thread context. Future users must + * Assign memory context to thread context. Use NULL to detach + * current memory context from thread. Future users must * know the context, since ch_free/slap_sl_context() cannot find it. */ void -slap_sl_mem_detach( +slap_sl_mem_setctx( void *thrctx, void *memctx ) { - SET_MEMCTX(thrctx, NULL, 0); + SET_MEMCTX(thrctx, memctx, slap_sl_mem_destroy); } void *