diff options
| author | Rob Arnold <robarnold@cs.cmu.edu> | 2011-07-28 08:19:00 -0700 |
|---|---|---|
| committer | Rob Arnold <robarnold@cs.cmu.edu> | 2011-07-28 08:28:32 -0700 |
| commit | f45ac8db07d81ade3725ecd9b2cb7783051ad7df (patch) | |
| tree | cfebbad936669fc407f572fd63276aa100ef21d9 /src/rt/memory_region.cpp | |
| parent | 19507787a9ecd7ad761d643416225781ab40a235 (diff) | |
| download | rust-f45ac8db07d81ade3725ecd9b2cb7783051ad7df.tar.gz rust-f45ac8db07d81ade3725ecd9b2cb7783051ad7df.zip | |
More useful leak debugging output.
When printing out leaked allocations, print the allocation tag and address of the returned pointer.
Diffstat (limited to 'src/rt/memory_region.cpp')
| -rw-r--r-- | src/rt/memory_region.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp index 6e651590197..2dd2a39916a 100644 --- a/src/rt/memory_region.cpp +++ b/src/rt/memory_region.cpp @@ -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); } } } |
