]> git.mdlowis.com Git - projs/libcds.git/commitdiff
Update mem module to count allocations and deletions for a lightweight form of leak...
authorMichael D. Lowis <mike@mdlowis.com>
Wed, 20 Aug 2014 02:43:46 +0000 (22:43 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Wed, 20 Aug 2014 02:43:46 +0000 (22:43 -0400)
source/mem/mem.c
tests/test_list.c

index 81b9b2d2317b90e59690e899a00dcd5f63ea27eb..643219b23bc28fc21c6fa69ea2329b00ac1ee21e 100644 (file)
@@ -158,6 +158,8 @@ void mem_release(void* p_obj)
     {
         #if (LEAK_DETECT_LEVEL == 2)
         deregister_block(p_obj);
+        #elif (LEAK_DETECT_LEVEL == 1)
+        Num_Allocations--;
         #endif
         if(p_hdr->p_finalize)
         {
index cd61a72439430fb4b43469a940ae01ddb573be6d..59652235d27635a4d6508d56f7d7123c3ee96ffb 100644 (file)
@@ -20,6 +20,7 @@ TEST_SUITE(List) {
         CHECK( NULL != list );
         CHECK( NULL == list->head );
         CHECK( NULL == list->tail );
+        mem_release( list );
     }
 
     //-------------------------------------------------------------------------