Skip to content

Commit b6be838

Browse files
robarnoldbrson
authored andcommitted
Log tags in memory_region::{free,realloc}
Make this useful and consistent with the destructor.
1 parent fd7ffd5 commit b6be838

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rt/memory_region.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ void memory_region::free(void *mem) {
4242
assert(alloc->magic == MAGIC);
4343
#ifdef TRACK_ALLOCATIONS
4444
if (_allocation_list[alloc->index] != alloc) {
45-
printf("free: ptr 0x%" PRIxPTR " is not in allocation_list\n",
46-
(uintptr_t) mem);
45+
printf("free: ptr 0x%" PRIxPTR " (%s) is not in allocation_list\n",
46+
(uintptr_t) &alloc->data, alloc->tag);
4747
_srv->fatal("not in allocation_list", __FILE__, __LINE__, "");
4848
}
4949
else {
@@ -73,8 +73,8 @@ memory_region::realloc(void *mem, size_t size) {
7373
if (_allocation_list[newMem->index] != alloc) {
7474
printf("at index %d, found %p, expected %p\n",
7575
alloc->index, _allocation_list[alloc->index], alloc);
76-
printf("realloc: ptr 0x%" PRIxPTR " is not in allocation_list\n",
77-
(uintptr_t) mem);
76+
printf("realloc: ptr 0x%" PRIxPTR " (%s) is not in allocation_list\n",
77+
(uintptr_t) &alloc->data, alloc->tag);
7878
_srv->fatal("not in allocation_list", __FILE__, __LINE__, "");
7979
}
8080
else {

0 commit comments

Comments
 (0)