mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-03 17:35:28 +03:00
More useful leak debugging output.
When printing out leaked allocations, print the allocation tag and address of the returned pointer.
This commit is contained in:
@@ -130,8 +130,10 @@ memory_region::~memory_region() {
|
||||
if (_detailed_leaks) {
|
||||
for (size_t i = 0; i < _allocation_list.size(); i++) {
|
||||
if (_allocation_list[i] != NULL) {
|
||||
printf("allocation 0x%" PRIxPTR " was not freed\n",
|
||||
(uintptr_t) _allocation_list[i]);
|
||||
alloc_header *header = (alloc_header*)_allocation_list[i];
|
||||
printf("allocation (%s) 0x%" PRIxPTR " was not freed\n",
|
||||
header->tag,
|
||||
(uintptr_t) &header->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user