hyc@OpenLDAP.org wrote:
rewrite-int.h 1.24 -> 1.25 ITS#6005 librewrite must use the same mem allocators as slapd
If you are killing C free/mallocs, here are some others from 'nm *.o' to look at. I don't have time at the moment. Hopefully most are malloced/freed by the same code, not passed to/from ber memory.
clients/tools/common.o: free malloc clients/tools/ldapcompare.o: free malloc clients/tools/ldappasswd.o: free clients/tools/ldapsearch.o: free malloc realloc clients/tools/ldapurl.o: free realloc libraries/liblber/memory.o: free malloc calloc realloc libraries/libldap/test.o: free malloc calloc realloc libraries/libldap_r/test.o: free malloc calloc realloc libraries/liblunicode/ure.o: free malloc calloc realloc libraries/liblutil/meter.o: free calloc libraries/liblutil/passwd.o: free libraries/liblutil/sha1.o: malloc libraries/librewrite/rewrite.o: free servers/slapd/alock.o: free calloc servers/slapd/sl_malloc.o: realloc tests/progs/slapd-addel.o: malloc calloc realloc tests/progs/slapd-bind.o: free realloc tests/progs/slapd-read.o: free malloc tests/progs/slapd-search.o: realloc tests/progs/slapd-tester.o: malloc calloc
Hallvard B Furuseth wrote:
hyc@OpenLDAP.org wrote:
rewrite-int.h 1.24 -> 1.25 ITS#6005 librewrite must use the same mem allocators as slapd
If you are killing C free/mallocs, here are some others from 'nm *.o' to look at. I don't have time at the moment. Hopefully most are malloced/freed by the same code, not passed to/from ber memory.
In general I'm only concerned with code that is linked into slapd. More specifically, code that allocates memory that other parts of slapd might try to manipulate/free.
clients/tools/common.o: free malloc clients/tools/ldapcompare.o: free malloc clients/tools/ldappasswd.o: free clients/tools/ldapsearch.o: free malloc realloc clients/tools/ldapurl.o: free realloc
Ignoring all of those.
libraries/liblber/memory.o: free malloc calloc realloc
Obviously those have to remain.
libraries/libldap/test.o: free malloc calloc realloc libraries/libldap_r/test.o: free malloc calloc realloc
Tests don't matter.
libraries/liblunicode/ure.o: free malloc calloc realloc libraries/liblutil/meter.o: free calloc libraries/liblutil/passwd.o: free libraries/liblutil/sha1.o: malloc libraries/librewrite/rewrite.o: free
Might have to look at those...
servers/slapd/alock.o: free calloc
Self-contained, the memory is never freed by anything else. But for consistency should probably use ch_* instead.
servers/slapd/sl_malloc.o: realloc
It's code that never executes, but should be fixed anyway...
tests/progs/slapd-addel.o: malloc calloc realloc tests/progs/slapd-bind.o: free realloc tests/progs/slapd-read.o: free malloc tests/progs/slapd-search.o: realloc tests/progs/slapd-tester.o: malloc calloc
Don't matter.
Howard Chu wrote:
libraries/liblunicode/ure.o: free malloc calloc realloc
Unicode regular expressions. None of our code uses this module.
libraries/liblutil/meter.o: free calloc
Self-contained. Also only used by slapadd.
libraries/liblutil/passwd.o: free
Was only used #ifdef CRYPT so I missed this before, fixed now.
libraries/liblutil/sha1.o: malloc
Inside lutil_SHA1End, never used in our code. It appears to be part of a set of wrappers tacked on to the base SHA1 hash implementation. Perhaps we should delete these wrappers since we never use them.
libraries/librewrite/rewrite.o: free
rewrite.c is standalone, not linked into anything else.
Might have to look at those...
servers/slapd/alock.o: free calloc
Self-contained, the memory is never freed by anything else. But for consistency should probably use ch_* instead.
Actually ber_mem*, but not important.