zig/src/memory_profiling.hpp
Michael Dusan 6c89f96df1
stage1: consolodate interning
- merge const_void_val → intern.x_void
- move const_zero_byte → intern.zero_byte
- wrap intern access
2019-11-25 17:18:56 -05:00

32 lines
682 B
C++

/*
* 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>
struct MemprofInternCount {
size_t x_undefined;
size_t x_void;
size_t x_null;
size_t x_unreachable;
size_t zero_byte;
};
extern MemprofInternCount memprof_intern_count;
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