From e2f8430e0023ce737134925fca4760eea7fa5e0c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 8 Sep 2016 22:33:55 -0500 Subject: [PATCH] debugging --- C/alloc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/C/alloc.c b/C/alloc.c index 62b53ce78..3987d04f5 100644 --- a/C/alloc.c +++ b/C/alloc.c @@ -21,10 +21,9 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" - -#include "alloc.h" #include "YapHeap.h" #include "Yatom.h" +#include "alloc.h" #include "yapio.h" #if HAVE_STRING_H #include @@ -78,6 +77,8 @@ void *my_malloc(size_t sz) { p = malloc(sz); // Yap_DebugPuts(stderr,"gof\n"); + if (Yap_do_low_level_trace) + fprintf(stderr, "+ %p : %lu\n", p, sz); if (sz > 500 && write_malloc++ > 0) __android_log_print(ANDROID_LOG_ERROR, "YAPDroid ", "+ %d %p", write_malloc, p); @@ -88,6 +89,8 @@ void *my_realloc(void *ptr, size_t sz) { void *p; p = realloc(ptr, sz); + if (Yap_do_low_level_trace) + fprintf(stderr, "+ %p -> %p : %lu\n", ptr, p, sz); // Yap_DebugPuts(stderr,"gof\n"); if (sz > 500 && write_malloc++ > 0) __android_log_print(ANDROID_LOG_ERROR, "YAPDroid ", "* %d %p", write_malloc, @@ -97,6 +100,8 @@ void *my_realloc(void *ptr, size_t sz) { void my_free(void *p) { // printf("f %p\n",p); + if (Yap_do_low_level_trace) + fprintf(stderr, "+ %p\n", p); if (write_malloc && write_malloc++ > 0) __android_log_print(ANDROID_LOG_ERROR, "YAPDroid ", "- %d %p", write_malloc, p);