aboutsummaryrefslogtreecommitdiff
path: root/src/memory_profiling.hpp
blob: 78e77a89f1d112a0916a47ab1383af1403de1cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * 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