[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Fw: [Q] attr.c bug?

At 03:55 PM 6/7/99 -0700, Alex Zeltser wrote:
>Is there a convention for which memory functions should be used when?

The "current" slapd convention is to use ch_* routines.
Besides doing error detection (and bogus handling), these
routines serve to place all allocations in one heap.

>Are we in the middle of switching approaches?


1) ch_* routines will be rewritten to use ber_mem* routines
instead of system allocators.  This will resolve the multiple
heap issue under NT.

2) macros will be created in <ac/stdlib.h>.  ch_* routines
will be rewritten to use these macros.  The macros will
initially point to ber_mem* routines.

3) each ch_* call will be reviewed.  The caller will be
reimplemented to 1) handle memory allocation faults and 2)
use the appropriate allocator/deallocator directly.
We haven't decided on what exact "appropriate" means in
this context.

4) the ch_* code will be removed.

5) extend <ac/stdlib.h> and -DLDAP_MEMORY_DEBUG to detect
wrong heap bugs (if we support multiple heaps).

Steps 1 and 2 straight forward.  Step 3 is where all the
real work is.  Step 4 is trivial.  Step 5 may not be needed
(depending on 3).