[Opensrf-commits] r1161 - trunk/src/libopensrf
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Dec 8 14:49:14 EST 2007
Author: miker
Date: 2007-12-08 14:29:09 -0500 (Sat, 08 Dec 2007)
New Revision: 1161
Modified:
trunk/src/libopensrf/osrf_json_object.c
Log:
tracking actual list length based on adds and uses
Modified: trunk/src/libopensrf/osrf_json_object.c
===================================================================
--- trunk/src/libopensrf/osrf_json_object.c 2007-12-08 19:09:57 UTC (rev 1160)
+++ trunk/src/libopensrf/osrf_json_object.c 2007-12-08 19:29:09 UTC (rev 1161)
@@ -43,6 +43,7 @@
static int unusedObjCapture = 0;
static int unusedObjRelease = 0;
static int mallocObjCreate = 0;
+static int currentListLen = 0;
union unusedObjUnion{
@@ -81,6 +82,7 @@
o = (jsonObject*) freeObjList;
freeObjList = freeObjList->next;
unusedObjRelease++;
+ currentListLen--;
} else {
OSRF_MALLOC( o, sizeof(jsonObject) );
mallocObjCreate++;
@@ -168,8 +170,9 @@
freeObjList = unused;
unusedObjCapture++;
+ currentListLen++;
if (unusedObjCapture > 1 && !(unusedObjCapture % 1000))
- osrfLogDebug( OSRF_LOG_MARK, "Objects malloc()'d: %d, Reusable objects captured: %d, Objects reused: %d", mallocObjCreate, unusedObjCapture, unusedObjRelease );
+ osrfLogDebug( OSRF_LOG_MARK, "Objects malloc()'d: %d, Reusable objects captured: %d, Objects reused: %d, Current List Length: %d", mallocObjCreate, unusedObjCapture, unusedObjRelease, currentListLen );
}
static void _jsonFreeHashItem(char* key, void* item){
More information about the opensrf-commits
mailing list