From: Kurt Zeilenga Date: Wed, 16 Feb 2000 23:51:34 +0000 (+0000) Subject: Add comment concern appropriate use of LDAP_MEMORY_DEBUG X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~3186 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6c6ecc15d58f399dcdc47e8fee36975485e9d218;p=openldap Add comment concern appropriate use of LDAP_MEMORY_DEBUG (basically, it's for testing internals, don't enable it otherwise) --- diff --git a/libraries/liblber/memory.c b/libraries/liblber/memory.c index 334ee9acfe..5f42c5d5c8 100644 --- a/libraries/liblber/memory.c +++ b/libraries/liblber/memory.c @@ -11,6 +11,17 @@ #include "lber-int.h" #if LDAP_MEMORY_DEBUG +/* + * LDAP_MEMORY_DEBUG should only be enabled for the purposes of + * debugging memory management within OpenLDAP libraries and slapd. + * It should only be enabled by an experienced developer as it + * causes the inclusion of numerous assert()'s, many of which may + * be triggered by a prefectly valid program. + * + * The code behind this macro is subject to change as needed to + * support this testing. + */ + struct ber_mem_hdr { union bmu_align_u { ber_len_t bmu_len_t; @@ -34,6 +45,7 @@ static const struct ber_mem_hdr ber_int_mem_hdr = { BER_MEM_JUNK }; assert( (p) != BER_MEM_BADADDR ); \ assert( (p) != (void *) &ber_int_mem_hdr ); \ } while(0) + #else #define BER_MEM_VALID(p) /* no-op */ #endif