blob: deb862fbec36c4e4e870f846ffc4fbb821a62900 (
plain) (
blame)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
* @file heapdebugger.h
*
* @author Ove Martin Malm
* @date Creation date: 2000-08-09
* @version $Id$
* @file mcheckhooks.h
*
* Copyright (c) : 1997-2000 Fast Search & Transfer ASA
* ALL RIGHTS RESERVED
*/
#pragma once
#include <cstddef>
/**
* This function is used for counting memory usage. Must be called before any block is allocated
* (pt. linux only)
* Parameter controls operation
*/
extern void enableHeapUsageMonitor(int param = 0);
/**
* This function return the current memory used.
* @return Net number of bytes allocated on the heap
*/
extern size_t getHeapUsage(void);
/**
* This enables heap debugging. Must be called before any block is allocated
* Parameter controls operation
* (pt. linux only)
*/
extern void enableHeapCorruptCheck(int param = 0);
#define HEAPCHECKMODE_REMOVE -1 // Deinstall
#define HEAPCHECKMODE_NORMAL 0 // Normal
#define HEAPCHECKMODE_EXTENSIVE 1 // All allocated blocks checked on all ops..
#define HEAPCHECKMODE_DISABLED 2 // No checking (but extra bytes allocated)
/**
* Run a heap check now. Will lock the heap and run through a full check. Will crash if it fails...
*/
extern void checkHeapNow(void);
/**
* And this enables linux mcheck function with an approprate callback function. (absolutely linux only)
* see man mcheck
*/
extern void enableMCheck(void);
|