Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/shared
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25637/ldap/servers/plugins/shared
Modified Files:
utils.c
Log Message:
Resolves: #466702
Summary: Memory usage research: checking in the experimental code
See also:
http://directory.fedoraproject.org/wiki/Memory_Usage_Research
Index: utils.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/shared/utils.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- utils.c 18 Oct 2007 00:08:32 -0000 1.7
+++ utils.c 15 Oct 2008 06:30:01 -0000 1.8
@@ -441,10 +441,10 @@
DNLink *cacheInit() {
DNLink *root;
slapi_lock_mutex(cache_lock);
- root = (DNLink *)malloc( sizeof(DNLink) );
+ root = (DNLink *)slapi_ch_malloc( sizeof(DNLink) );
root->next = NULL;
root->data = NULL;
- root->dn = (char *)malloc(1);
+ root->dn = (char *)slapi_ch_malloc(1);
root->dn[0] = 0;
slapi_unlock_mutex(cache_lock);
return root;
@@ -457,7 +457,7 @@
slapi_lock_mutex(cache_lock);
for( ; root->next; root = root->next ) {
}
- root->next = (DNLink *)malloc( sizeof(DNLink) );
+ root->next = (DNLink *)slapi_ch_malloc( sizeof(DNLink) );
root = root->next;
root->dn = dn;
root->data = data;