|
@@ -55,9 +55,16 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
|
|
posix_lock(heap);
|
|
posix_lock(heap);
|
|
#endif /* HAVE_LOCKS */
|
|
#endif /* HAVE_LOCKS */
|
|
|
|
|
|
-#if defined (WITH_STATS) && defined (REQUEST_SIZE_INFO)
|
|
|
|
|
|
+#ifdef WITH_STATS
|
|
|
|
+ /* Update Stats */
|
|
|
|
+#ifdef REQUEST_SIZE_INFO
|
|
heap->dmm_stats.mem_requested -= get_requested_size(ptr);
|
|
heap->dmm_stats.mem_requested -= get_requested_size(ptr);
|
|
-#endif /* WITH_STATS && REQUEST_SIZE_INFO */
|
|
|
|
|
|
+#endif /* REQUEST_SIZE_INFO */
|
|
|
|
+ heap->dmm_stats.mem_used -= HEADER_SIZE + size;
|
|
|
|
+ heap->dmm_stats.live_objects -= 1;
|
|
|
|
+ heap->dmm_stats.num_free += 1;
|
|
|
|
+ /* End of Stats */
|
|
|
|
+#endif /* WITH_STATS */
|
|
|
|
|
|
#ifdef COUNT_HOPS
|
|
#ifdef COUNT_HOPS
|
|
/* Initialize the hops counter */
|
|
/* Initialize the hops counter */
|
|
@@ -217,14 +224,6 @@ void custom_ahfree(allocator_t *allocator, heap_t* heap, void *ptr) {
|
|
}
|
|
}
|
|
#endif /* WITH_FIXED_LISTS */
|
|
#endif /* WITH_FIXED_LISTS */
|
|
|
|
|
|
-#ifdef WITH_STATS
|
|
|
|
- /* Update Stats */
|
|
|
|
- heap->dmm_stats.mem_used -= HEADER_SIZE + size;
|
|
|
|
- heap->dmm_stats.live_objects -= 1;
|
|
|
|
- heap->dmm_stats.num_free += 1;
|
|
|
|
- /* End of Stats */
|
|
|
|
-#endif /* WITH_STATS */
|
|
|
|
-
|
|
|
|
#ifdef WITH_ADAPTIVITY
|
|
#ifdef WITH_ADAPTIVITY
|
|
/* Refresh the state of the heap allocator if a certain number of
|
|
/* Refresh the state of the heap allocator if a certain number of
|
|
* free's has been served already
|
|
* free's has been served already
|