|
@@ -41,29 +41,29 @@
|
|
|
*/
|
|
|
void freelist_free(freelist_rb_t *raw_block, void *ptr) {
|
|
|
|
|
|
- ptr = get_header(ptr);
|
|
|
+ block_header_t *block = get_header(ptr);
|
|
|
|
|
|
#ifndef REQUEST_SIZE_INFO
|
|
|
TRACE_1("dmmlib - free - free'ing %zu bytes from freelist raw block %p\n",
|
|
|
- get_size(ptr), (void *)raw_block);
|
|
|
+ get_size(block), (void *)raw_block);
|
|
|
#else /* REQUEST_SIZE_INFO */
|
|
|
TRACE_1("dmmlib - free - free'ing %zu bytes from freelist raw block %p, out of "
|
|
|
"which %zu were used by the application\n",
|
|
|
- get_size(ptr),
|
|
|
+ get_size(block),
|
|
|
(void *)raw_block,
|
|
|
- get_requested_size(ptr));
|
|
|
+ get_requested_size(block));
|
|
|
#endif /* REQUEST_SIZE_INFO */
|
|
|
|
|
|
// Memory stats get updated here in case the space gets coalesced with its
|
|
|
// free neighbors.
|
|
|
#ifdef WITH_ALLOCATOR_STATS
|
|
|
systemallocator.dmm_stats.total_mem_allocated -=
|
|
|
- get_size(ptr) + HEADER_SIZE;
|
|
|
+ get_size(block) + HEADER_SIZE;
|
|
|
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 -=
|
|
|
- get_requested_size(ptr);
|
|
|
+ get_requested_size(block);
|
|
|
TRACE_1("dmmlib - global requested memory: %zu bytes\n",
|
|
|
systemallocator.dmm_stats.total_mem_requested);
|
|
|
#endif /* REQUEST_SIZE_INFO */
|
|
@@ -72,10 +72,10 @@ void freelist_free(freelist_rb_t *raw_block, void *ptr) {
|
|
|
#endif /* WITH_ALLOCATOR_STATS */
|
|
|
|
|
|
#if defined (COALESCING_FIXED) || defined (COALESCING_VARIABLE)
|
|
|
- coalesce(raw_block, ptr);
|
|
|
+ coalesce(raw_block, block);
|
|
|
#else
|
|
|
- mark_free(raw_block, ptr);
|
|
|
- add_block(raw_block, ptr);
|
|
|
+ mark_free(raw_block, block);
|
|
|
+ add_block(raw_block, block);
|
|
|
#endif /* COALESCING_FIXED || COALESCING_VARIABLE */
|
|
|
|
|
|
}
|