|
|
|
@ -209,14 +209,6 @@ char* u_strdup_impl(const char* s, const char* location) { |
|
|
|
return copy; |
|
|
|
return copy; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void u_mem_get_counters(size_t* allocations, size_t* frees, size_t* allocated) { |
|
|
|
|
|
|
|
LOCK(); |
|
|
|
|
|
|
|
if (allocations) *allocations = allocations_count; |
|
|
|
|
|
|
|
if (frees) *frees = frees_count; |
|
|
|
|
|
|
|
if (allocated) *allocated = allocated_count; |
|
|
|
|
|
|
|
UNLOCK(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void u_report_unfreed_blocks(void) { |
|
|
|
void u_report_unfreed_blocks(void) { |
|
|
|
LOCK(); |
|
|
|
LOCK(); |
|
|
|
size_t count = allocated_count; |
|
|
|
size_t count = allocated_count; |
|
|
|
@ -229,7 +221,7 @@ void u_report_unfreed_blocks(void) { |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "No unfreed memory blocks."); |
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_MEMORY, "No unfreed memory blocks."); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_MEMORY, "Unfreed memory blocks: %zu", count); |
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_MEMORY, "Unfreed memory blocks: %zu, allocations: %zu frees: %zu", count, allocations_count, frees_count); |
|
|
|
void* curr = head; |
|
|
|
void* curr = head; |
|
|
|
while (curr) { |
|
|
|
while (curr) { |
|
|
|
char* alloc_loc = (char*)curr; |
|
|
|
char* alloc_loc = (char*)curr; |
|
|
|
|