]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/system/PoolP.nc
Debug messages for size to help find memory leaks.
[tinyos-2.x.git] / tos / system / PoolP.nc
index 0dc44e5319d1c1b1d54cd1b3c94f3994e99c5da5..14dbec6659d266e7c1b2111664568d69aaae786e 100644 (file)
@@ -59,7 +59,7 @@ generic module PoolP(typedef pool_t, uint8_t size) {
 implementation {
   uint8_t free;
   uint8_t index;
-  pool_t* queue[size];
+  pool_t* ONE_NOK queue[size];
   pool_t pool[size];
 
   command error_t Init.init() {
@@ -73,9 +73,11 @@ implementation {
   }
   
   command bool Pool.empty() {
+    dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
     return free == 0;
   }
   command uint8_t Pool.size() {
+    dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
     return free;
   }
     
@@ -92,6 +94,7 @@ implementation {
       if (index == size) {
         index = 0;
       }
+      dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
       return rval;
     }
     return NULL;
@@ -108,6 +111,7 @@ implementation {
       }
       queue[emptyIndex] = newVal;
       free++;
+      dbg("PoolP", "%s size is %i\n", __FUNCTION__, (int)free);
       return SUCCESS;
     }
   }