-
Notifications
You must be signed in to change notification settings - Fork 2
/
meter.h
47 lines (36 loc) · 1.11 KB
/
meter.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright (c) 2010, the Short-term Memory Project Authors.
* All rights reserved. Please see the AUTHORS file for details.
* Use of this source code is governed by a BSD license that
* can be found in the LICENSE file.
*/
#ifndef _METER_H_
#define _METER_H_
#ifdef SCM_RECORD_MEMORY_USAGE
#include <stdio.h>
#include <sys/time.h>
#include "debug.h"
/**
* Keeps track of the allocated memory
*/
void inc_allocated_mem(long inc) __attribute__((visibility("hidden")));
/**
* Keeps track of the freed memory
*/
void inc_freed_mem(long inc) __attribute__((visibility("hidden")));
/**
* Keeps track of the pooled memory
*/
void inc_pooled_mem(long inc) __attribute__((visibility("hidden")));
void dec_pooled_mem(long inc) __attribute__((visibility("hidden")));
/**
* Keeps track of the memory overhead
*/
void inc_overhead(long inc) __attribute__((visibility("hidden")));
void dec_overhead(long inc) __attribute__((visibility("hidden")));
/**
* Prints memory consumption
*/
void print_memory_consumption(void) __attribute__((visibility("hidden")));
#endif /* SCM_RECORD_MEMORY_USAGE */
#endif /* _METER_H_ */