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

Re: slap_sl_malloc



Jong-Hyuk wrote:

I've just checked in a potential patch for ITS#3296.
The problem I found is that normalized values in many normalizers (including
that for UUID) are currently allocated by sl_malloc.
I think they should be allocated by using ch_malloc because they are stored
in entry and hence are permanent.


I don't think this is the right approach. The caller of the normalizer should pass in a NULL tmpmemctx if permanent storage is desired.

For the toggling feature, I'd rather track down the usages of sl_malloc()
first if the toggling feature is not meant to be the first level solution
but a temp workaround.


It is not meant to be a workaround at all, just a debugging aid when searching for memory leaks. I guess it can be a compile-time option instead, but I'd rather minimize the need for recompilation.

I was actually thinking of adding a config keyword to enable/disable
sl_malloc, and replacing all the direct calls in the source with calls
thru the sl_mfuncs structure. Then most of its functionality can be
toggled just by changing that single structure. This would make testing
for memleaks a bit easier.




.





--
 -- Howard Chu
 Chief Architect, Symas Corp.       Director, Highland Sun
 http://www.symas.com               http://highlandsun.com/hyc
 Symas: Premier OpenSource Development and Support