diff options
author | Iliyan Malchev <malchev@google.com> | 2011-08-24 18:24:36 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-08-24 18:25:36 -0700 |
commit | c395dad56e99173f623b86ef1c62b94cdee7fce9 (patch) | |
tree | 0f32c3e21425f1d6c103a4f5cb9885154da3186a /heaptracker.c | |
parent | 7b5c10bcab4aebb5f3c2b3cc07b6407b78d86774 (diff) | |
download | hardware_ti_omap4-c395dad56e99173f623b86ef1c62b94cdee7fce9.tar.gz hardware_ti_omap4-c395dad56e99173f623b86ef1c62b94cdee7fce9.tar.bz2 hardware_ti_omap4-c395dad56e99173f623b86ef1c62b94cdee7fce9.zip |
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.c | 6 |
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); |