Skip to content

Commit

Permalink
format code and remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
Meiyou Chen committed Jun 2, 2021
1 parent 890228a commit 3aa298f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 10 additions & 10 deletions src/leak_builtin.c
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
#include <stdio.h>
#include <stdlib.h>
#include <android/log.h>
#include <string.h>
#include <unistd.h>

#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;
Expand Down
1 change: 0 additions & 1 deletion src/leak_test.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <android/log.h>
#include <string.h>
#include <unistd.h>

Expand Down

0 comments on commit 3aa298f

Please sign in to comment.