From 6c6ecc15d58f399dcdc47e8fee36975485e9d218 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 16 Feb 2000 23:51:34 +0000 Subject: [PATCH] Add comment concern appropriate use of LDAP_MEMORY_DEBUG (basically, it's for testing internals, don't enable it otherwise) --- libraries/liblber/memory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.39.5