about summary refs log tree commit diff
path: root/src/rt/memory_region.cpp
diff options
context:
space:
mode:
authorRob Arnold <robarnold@cs.cmu.edu>2011-08-03 20:33:22 -0700
committerBrian Anderson <banderson@mozilla.com>2011-08-05 11:57:06 -0700
commitb6be83885f26c02888b17cdca78edb8d125e36cb (patch)
tree38ac6a0e5a7d351d1d76d6a19497330e737c4101 /src/rt/memory_region.cpp
parentfd7ffd5ac27aa131a858a8a4954c545ece48644b (diff)
downloadrust-b6be83885f26c02888b17cdca78edb8d125e36cb.tar.gz
rust-b6be83885f26c02888b17cdca78edb8d125e36cb.zip
Log tags in memory_region::{free,realloc}
Make this useful and consistent with the destructor.
Diffstat (limited to 'src/rt/memory_region.cpp')
-rw-r--r--src/rt/memory_region.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rt/memory_region.cpp b/src/rt/memory_region.cpp
index a862dc4b7b5..1d49fb6114e 100644
--- a/src/rt/memory_region.cpp
+++ b/src/rt/memory_region.cpp
@@ -42,8 +42,8 @@ void memory_region::free(void *mem) {
     assert(alloc->magic == MAGIC);
 #ifdef TRACK_ALLOCATIONS
     if (_allocation_list[alloc->index] != alloc) {
-        printf("free: ptr 0x%" PRIxPTR " is not in allocation_list\n",
-               (uintptr_t) mem);
+        printf("free: ptr 0x%" PRIxPTR " (%s) is not in allocation_list\n",
+               (uintptr_t) &alloc->data, alloc->tag);
         _srv->fatal("not in allocation_list", __FILE__, __LINE__, "");
     }
     else {
@@ -73,8 +73,8 @@ memory_region::realloc(void *mem, size_t size) {
     if (_allocation_list[newMem->index] != alloc) {
         printf("at index %d, found %p, expected %p\n",
                alloc->index, _allocation_list[alloc->index], alloc);
-        printf("realloc: ptr 0x%" PRIxPTR " is not in allocation_list\n",
-            (uintptr_t) mem);
+        printf("realloc: ptr 0x%" PRIxPTR " (%s) is not in allocation_list\n",
+            (uintptr_t) &alloc->data, alloc->tag);
         _srv->fatal("not in allocation_list", __FILE__, __LINE__, "");
     }
     else {