aboutsummaryrefslogtreecommitdiff
path: root/src/memory_profiling.hpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-10-19 12:42:32 -0400
committerGitHub <noreply@github.com>2019-10-19 12:42:32 -0400
commit63dfca97159fd66563693039606c0bca30aa1f85 (patch)
tree7975692d2f2934f19d13a1784db87619c525bcaf /src/memory_profiling.hpp
parente42d86b657c2fae093fb2545e8b4b85614a0c906 (diff)
parent4e985123447dba40e282e9663e3ca669d3f9243a (diff)
downloadzig-63dfca97159fd66563693039606c0bca30aa1f85.tar.gz
zig-63dfca97159fd66563693039606c0bca30aa1f85.zip
Merge pull request #3482 from ziglang/mem-usage-report
add -DZIG_ENABLE_MEM_PROFILE option and -fmem-report flag
Diffstat (limited to 'src/memory_profiling.hpp')
-rw-r--r--src/memory_profiling.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/memory_profiling.hpp b/src/memory_profiling.hpp
new file mode 100644
index 0000000000..6d43d81e3c
--- /dev/null
+++ b/src/memory_profiling.hpp
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2019 Andrew Kelley
+ *
+ * This file is part of zig, which is MIT licensed.
+ * See http://opensource.org/licenses/MIT
+ */
+
+#ifndef ZIG_MEMORY_PROFILING_HPP
+#define ZIG_MEMORY_PROFILING_HPP
+
+#include "config.h"
+
+#include <stddef.h>
+#include <stdio.h>
+
+void memprof_init(void);
+
+void memprof_alloc(const char *name, size_t item_count, size_t type_size);
+void memprof_dealloc(const char *name, size_t item_count, size_t type_size);
+
+void memprof_dump_stats(FILE *file);
+#endif