Index: src/main.cpp |
diff --git a/src/main.cpp b/src/main.cpp |
index baaa39ef8adc0cbf17e2ae0021ff1f073b05a3f4..9cb6be281a08c4a6acd6b981bf4f94d616a8712f 100644 |
--- a/src/main.cpp |
+++ b/src/main.cpp |
@@ -16,6 +16,9 @@ |
#include "IceBrowserCompileServer.h" |
#include "IceBuildDefs.h" |
#include "IceCompileServer.h" |
+#ifdef ALLOW_LINUX_MALLOC_PROFILE |
+#include "LinuxMallocProfiling.h" |
+#endif // ALLOW_LINUX_MALLOC_PROFILE |
#ifdef __pnacl__ |
#include <malloc.h> |
@@ -30,6 +33,9 @@ |
/// We can only compile the Ice::BrowserCompileServer object with the PNaCl |
/// compiler toolchain, when building Subzero as a sandboxed translator. |
int main(int argc, char **argv) { |
+#ifdef ALLOW_LINUX_MALLOC_PROFILE |
+ Ice::LinuxMallocProfiling::Start(); |
+#endif // ALLOW_LINUX_MALLOC_PROFILE |
#ifdef __pnacl__ |
#define M_GRANULARITY (-2) |
// PNaCl's default malloc implementation grabs small chunks of memory with |
@@ -43,5 +49,9 @@ int main(int argc, char **argv) { |
assert(argc == 1); |
return Ice::BrowserCompileServer().runAndReturnErrorCode(); |
} |
- return Ice::CLCompileServer(argc, argv).runAndReturnErrorCode(); |
+ int error = Ice::CLCompileServer(argc, argv).runAndReturnErrorCode(); |
Jim Stichnoth
2016/03/12 00:12:58
s/error/Error/
sehr
2016/03/15 00:36:46
Done.
|
+#ifdef ALLOW_LINUX_MALLOC_PROFILE |
+ Ice::LinuxMallocProfiling::End(); |
+#endif // ALLOW_LINUX_MALLOC_PROFILE |
+ return error; |
} |