diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-19 12:42:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-19 12:42:32 -0400 |
| commit | 63dfca97159fd66563693039606c0bca30aa1f85 (patch) | |
| tree | 7975692d2f2934f19d13a1784db87619c525bcaf /src/memory_profiling.hpp | |
| parent | e42d86b657c2fae093fb2545e8b4b85614a0c906 (diff) | |
| parent | 4e985123447dba40e282e9663e3ca669d3f9243a (diff) | |
| download | zig-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.hpp | 22 |
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 |
