debugging
This commit is contained in:
parent
c46228a03b
commit
e2f8430e00
@ -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 <string.h>
|
||||
@ -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);
|
||||
|
Reference in New Issue
Block a user