X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fmalloc_simple.c;h=0a004d40e1ec80ae9e7b5d61c4f8d831462083d8;hb=319d309b58f863cbb8dcb240ace6af17dc98939b;hp=67ee623850e0f8dbeb4a3aadc975deaac2e42486;hpb=162c22bfbc4141f22937c6bc37aa02fd4621e76c;p=platform%2Fkernel%2Fu-boot.git diff --git a/common/malloc_simple.c b/common/malloc_simple.c index 67ee623..0a004d4 100644 --- a/common/malloc_simple.c +++ b/common/malloc_simple.c @@ -13,6 +13,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -45,6 +46,7 @@ void *malloc_simple(size_t bytes) return ptr; log_debug("%lx\n", (ulong)ptr); + VALGRIND_MALLOCLIKE_BLOCK(ptr, bytes, 0, false); return ptr; } @@ -57,6 +59,7 @@ void *memalign_simple(size_t align, size_t bytes) if (!ptr) return ptr; log_debug("aligned to %lx\n", (ulong)ptr); + VALGRIND_MALLOCLIKE_BLOCK(ptr, bytes, 0, false); return ptr; } @@ -74,6 +77,13 @@ void *calloc(size_t nmemb, size_t elem_size) return ptr; } + +#if IS_ENABLED(CONFIG_VALGRIND) +void free_simple(void *ptr) +{ + VALGRIND_FREELIKE_BLOCK(ptr, 0); +} +#endif #endif void malloc_simple_info(void)