diff --git a/src/leak_builtin.c b/src/leak_builtin.c index 0b76d14..6d57136 100644 --- a/src/leak_builtin.c +++ b/src/leak_builtin.c @@ -1,34 +1,34 @@ #include #include -#include #include #include #include "libheapsnap.h" -void* foo(void) +void *foo(void) { - void* p = malloc(4096); + void *p = malloc(4096); memset(p, 0x5A, 4096); return p; } int main(void) { - int count=0; - void * p = NULL; + int count = 0; + void *p = NULL; printf("My PID: %d\n\n", getpid()); system("chmod 0777 /data/local/tmp"); - while(1) { + while (1) { p = foo(); ++count; printf("%d: %p\n", count, p); - if (count%3 == 0) { - printf("Save heap info\n"); - heapsnap_save(); - } + if (count % 3 == 0) + { + printf("Save heap info\n"); + heapsnap_save(); + } sleep(3); } return 0; diff --git a/src/leak_test.c b/src/leak_test.c index ee6b96b..eba6ecd 100644 --- a/src/leak_test.c +++ b/src/leak_test.c @@ -1,6 +1,5 @@ #include #include -#include #include #include