|
@@ -29,6 +29,7 @@
|
|
|
#include "trace.h"
|
|
|
|
|
|
#ifdef WITH_ALLOCATOR_STATS
|
|
|
+#include "statistics.h"
|
|
|
#include "dmmlib/dmmlib.h"
|
|
|
#endif /* WITH_ALLOCATOR_STATS */
|
|
|
|
|
@@ -45,31 +46,6 @@ void bitmap_free(bitmap_rb_t *raw_block, void *ptr) {
|
|
|
|
|
|
cells_used = chunk_header->num_of_cells;
|
|
|
|
|
|
-#ifndef REQUEST_SIZE_INFO
|
|
|
- TRACE_1("dmmlib - free - free'ing %zu bytes from bitmap raw block %p\n",
|
|
|
- cells_used * raw_block->bytes_per_cell, (void *)raw_block);
|
|
|
-#else /* REQUEST_SIZE_INFO */
|
|
|
- TRACE_1("dmmlib - free - free'ing %zu bytes from bitmap raw block %p, out of "
|
|
|
- "which %zu were used by the application\n",
|
|
|
- cells_used * raw_block->bytes_per_cell,
|
|
|
- (void *)raw_block,
|
|
|
- chunk_header->requested_size);
|
|
|
-#endif /* REQUEST_SIZE_INFO */
|
|
|
-
|
|
|
-#ifdef WITH_ALLOCATOR_STATS
|
|
|
- systemallocator.dmm_stats.total_mem_allocated -= cells_used *
|
|
|
- raw_block->bytes_per_cell;
|
|
|
- TRACE_1("dmmlib - global allocated memory: %zu bytes\n",
|
|
|
- systemallocator.dmm_stats.total_mem_allocated);
|
|
|
-#ifdef REQUEST_SIZE_INFO
|
|
|
- systemallocator.dmm_stats.total_mem_requested -= chunk_header->requested_size;
|
|
|
- TRACE_1("dmmlib - global requested memory: %zu bytes\n",
|
|
|
- systemallocator.dmm_stats.total_mem_requested);
|
|
|
-#endif /* REQUEST_SIZE_INFO */
|
|
|
- systemallocator.dmm_stats.live_objects--;
|
|
|
- systemallocator.dmm_stats.num_free++;
|
|
|
-#endif /* WITH_ALLOCATOR_STATS */
|
|
|
-
|
|
|
cell_no = (size_t) ((char *)chunk_header -
|
|
|
((char *)raw_block + sizeof(bitmap_rb_t) +
|
|
|
raw_block->elements * BMAP_EL_SIZE))
|
|
@@ -94,4 +70,25 @@ void bitmap_free(bitmap_rb_t *raw_block, void *ptr) {
|
|
|
mask_counter = 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+#ifndef REQUEST_SIZE_INFO
|
|
|
+ TRACE_1("dmmlib - free - free'ing %zu bytes from bitmap raw block %p\n",
|
|
|
+ cells_used * raw_block->bytes_per_cell, (void *)raw_block);
|
|
|
+#else /* REQUEST_SIZE_INFO */
|
|
|
+ TRACE_1("dmmlib - free - free'ing %zu bytes from bitmap raw block %p, "
|
|
|
+ "out of which %zu were used by the application\n",
|
|
|
+ cells_used * raw_block->bytes_per_cell,
|
|
|
+ (void *)raw_block,
|
|
|
+ chunk_header->requested_size);
|
|
|
+#endif /* REQUEST_SIZE_INFO */
|
|
|
+
|
|
|
+#ifdef WITH_ALLOCATOR_STATS
|
|
|
+ update_stats(&systemallocator.dmm_stats,
|
|
|
+ FREE,
|
|
|
+#ifdef REQUEST_SIZE_INFO
|
|
|
+ chunk_header->requested_size,
|
|
|
+#endif /* REQUEST_SIZE_INFO */
|
|
|
+ cells_used * raw_block->bytes_per_cell);
|
|
|
+#endif /* WITH_ALLOCATOR_STATS */
|
|
|
+
|
|
|
}
|