diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2018-08-24 22:15:32 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2018-08-24 22:15:32 +0200 |
| commit | 933592db4782b0fe155231f805e017330efd5f65 (patch) | |
| tree | 95f0a128a5c846db7a4c9b8a354133776d78f6b0 /print_status_on_exit.c | |
| parent | 423cc4f28dc7fbf86ee951a22b7c69cfe3d0131c (diff) | |
| download | allocbench-933592db4782b0fe155231f805e017330efd5f65.tar.gz allocbench-933592db4782b0fe155231f805e017330efd5f65.zip | |
use new memusage gathering in loop
Diffstat (limited to 'print_status_on_exit.c')
| -rw-r--r-- | print_status_on_exit.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/print_status_on_exit.c b/print_status_on_exit.c index 686817e..e2363c9 100644 --- a/print_status_on_exit.c +++ b/print_status_on_exit.c @@ -64,8 +64,6 @@ void *malloc(size_t size) initializing = 1; init(); initializing = 0; - - fprintf(stdout, "jcheck: allocated %lu bytes of temp memory in %lu chunks during initialization\n", tmppos, tmpallocs); } else { @@ -78,12 +76,11 @@ void *malloc(size_t size) } else { - fprintf(stdout, "jcheck: too much memory requested during initialisation - increase tmpbuff size\n"); + fprintf(stderr, "jcheck: too much memory requested during initialisation - increase tmpbuff size\n"); exit(1); } } } - return myfn_malloc(size); } @@ -92,9 +89,7 @@ void free(void *ptr) // something wrong if we call free before one of the allocators! if (myfn_malloc == NULL) init(); - if (ptr >= (void*) tmpbuff && ptr <= (void*)(tmpbuff + tmppos)) - fprintf(stdout, "freeing temp memory\n"); - else + if (!(ptr >= (void*) tmpbuff && ptr <= (void*)(tmpbuff + tmppos))) myfn_free(ptr); } |
