aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-08-10 16:00:50 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-08-10 16:00:50 +0200
commit8890859baa246470c82ebdbd46c4e15ac226175b (patch)
tree5591d126fa8456e9181e9b1cce7dc8e4577eb00d
parentc59dd31434018e74b44b0b5c8a79552a96c829a1 (diff)
downloadallocbench-8890859baa246470c82ebdbd46c4e15ac226175b.tar.gz
allocbench-8890859baa246470c82ebdbd46c4e15ac226175b.zip
print malloc_stats to stdout
-rw-r--r--src/benchmarks/t_test1/t-test1.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/benchmarks/t_test1/t-test1.c b/src/benchmarks/t_test1/t-test1.c
index 86eb034..7418693 100644
--- a/src/benchmarks/t_test1/t-test1.c
+++ b/src/benchmarks/t_test1/t-test1.c
@@ -38,9 +38,9 @@
#endif
#include <stdio.h>
+#include <unistd.h>
#ifdef __GCC__
-#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>
@@ -394,6 +394,9 @@ int main(int argc, char *argv[])
if (st[i].sp) free(st[i].sp);
}
free(st);
+ // Print malloc_stats to stdout
+ close(STDERR_FILENO);
+ dup2(STDOUT_FILENO, STDERR_FILENO);
malloc_stats();
printf("Done.\n");
return 0;