Drizzled Public API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
mem0dbg.h
Go to the documentation of this file.
1
/*****************************************************************************
2
3
Copyright (C) 1994, 2010, Innobase Oy. All Rights Reserved.
4
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License along with
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
16
17
*****************************************************************************/
18
19
/**************************************************/
27
/* In the debug version each allocated field is surrounded with
28
check fields whose sizes are given below */
29
30
#pragma once
31
#ifdef UNIV_MEM_DEBUG
32
# ifndef UNIV_HOTBACKUP
33
/* The mutex which protects in the debug version the hash table
34
containing the list of live memory heaps, and also the global
35
variables in mem0dbg.c. */
36
extern
mutex_t
mem_hash_mutex;
37
# endif
/* !UNIV_HOTBACKUP */
38
39
#define MEM_FIELD_HEADER_SIZE ut_calc_align(2 * sizeof(ulint),\
40
UNIV_MEM_ALIGNMENT)
41
#define MEM_FIELD_TRAILER_SIZE sizeof(ulint)
42
#else
43
#define MEM_FIELD_HEADER_SIZE 0
44
#endif
45
46
47
/* Space needed when allocating for a user a field of
48
length N. The space is allocated only in multiples of
49
UNIV_MEM_ALIGNMENT. In the debug version there are also
50
check fields at the both ends of the field. */
51
#ifdef UNIV_MEM_DEBUG
52
#define MEM_SPACE_NEEDED(N) ut_calc_align((N) + MEM_FIELD_HEADER_SIZE\
53
+ MEM_FIELD_TRAILER_SIZE, UNIV_MEM_ALIGNMENT)
54
#else
55
#define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT)
56
#endif
57
58
#if defined UNIV_MEM_DEBUG || defined UNIV_DEBUG
59
/***************************************************************/
65
UNIV_INTERN
66
void
67
mem_heap_validate_or_print(
68
/*=======================*/
69
mem_heap_t
* heap,
70
byte* top,
73
ibool print,
76
ibool* error,
77
ulint* us_size,
82
ulint* ph_size,
85
ulint* n_blocks);
88
/**************************************************************/
91
UNIV_INTERN
92
ibool
93
mem_heap_validate(
94
/*==============*/
95
mem_heap_t
* heap);
96
#endif
/* UNIV_MEM_DEBUG || UNIV_DEBUG */
97
#ifdef UNIV_DEBUG
98
/**************************************************************/
101
UNIV_INTERN
102
ibool
103
mem_heap_check(
104
/*===========*/
105
mem_heap_t
* heap);
106
#endif
/* UNIV_DEBUG */
107
#ifdef UNIV_MEM_DEBUG
108
/*****************************************************************/
111
UNIV_INTERN
112
ibool
113
mem_all_freed(
void
);
114
/*===============*/
115
/*****************************************************************/
118
UNIV_INTERN
119
ibool
120
mem_validate_no_assert(
void
);
121
/*=========================*/
122
/************************************************************/
125
UNIV_INTERN
126
ibool
127
mem_validate(
void
);
128
/*===============*/
129
#endif
/* UNIV_MEM_DEBUG */
130
/************************************************************/
133
UNIV_INTERN
134
void
135
mem_analyze_corruption
(
136
/*===================*/
137
void
* ptr);
138
/*****************************************************************/
141
UNIV_INTERN
142
void
143
mem_print_info
(
void
);
144
/*================*/
145
/*****************************************************************/
148
UNIV_INTERN
149
void
150
mem_print_new_info
(
void
);
151
/*====================*/
plugin
innobase
include
mem0dbg.h
Generated on Sun Jun 3 2012 18:09:25 for drizzle by
1.8.1