summaryrefslogtreecommitdiffstats
path: root/heaptracker.c
diff options
context:
space:
mode:
authorIliyan Malchev <malchev@google.com>2011-08-24 18:24:36 -0700
committerIliyan Malchev <malchev@google.com>2011-08-24 18:25:36 -0700
commit48fbdeb14d1a916f7e769b4d7f76e714e6df8c5d (patch)
tree6d6bcafa3802fe251542411fcadfb9fc9f5b5b8c /heaptracker.c
parent518eb6cf51f7566d04bcd4a8849f01bb87f666a3 (diff)
downloadhardware_ti_omap4xxx-48fbdeb14d1a916f7e769b4d7f76e714e6df8c5d.zip
hardware_ti_omap4xxx-48fbdeb14d1a916f7e769b4d7f76e714e6df8c5d.tar.gz
hardware_ti_omap4xxx-48fbdeb14d1a916f7e769b4d7f76e714e6df8c5d.tar.bz2
omap4xxx: fix realloc & calloc in heaptracker
Change-Id: I9aa41b66f520b551f3923a62b11b0f1dbd0ed03a Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'heaptracker.c')
-rw-r--r--heaptracker.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/heaptracker.c b/heaptracker.c
index 84c2f49..825abd6 100644
--- a/heaptracker.c
+++ b/heaptracker.c
@@ -353,7 +353,7 @@ void* __wrap_malloc(size_t size)
hdr->bt_depth = heaptracker_stacktrace(
hdr->bt, MAX_BACKTRACE_DEPTH);
add(hdr, size);
- return hdr+1;
+ return user(hdr);
}
return NULL;
}
@@ -448,7 +448,7 @@ void *__wrap_realloc(void *ptr, size_t size)
}
}
- hdr = __real_realloc(hdr, sizeof(struct hdr) + size);
+ hdr = __real_realloc(hdr, sizeof(struct hdr) + size + sizeof(struct ftr));
if (hdr) {
hdr->bt_depth = heaptracker_stacktrace(hdr->bt, MAX_BACKTRACE_DEPTH);
add(hdr, size);
@@ -463,7 +463,7 @@ void *__wrap_calloc(int nmemb, size_t size)
// malloc_tracker_log("%s: %s\n", __FILE__, __FUNCTION__);
struct hdr *hdr;
size_t __size = nmemb * size;
- hdr = __real_calloc(1, sizeof(struct hdr) + __size);
+ hdr = __real_calloc(1, sizeof(struct hdr) + __size + sizeof(struct ftr));
if (hdr) {
hdr->bt_depth = heaptracker_stacktrace(
hdr->bt, MAX_BACKTRACE_DEPTH);