~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/mem0dbg.h

  • Committer: Monty Taylor
  • Date: 2009-08-12 06:25:19 UTC
  • mto: (1114.1.1 innodb-plugin-merge)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090812062519-cij02mrrunvnxblt
Tags: innodb-plugin-1.0.4
InnoDB Plugin 1.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/******************************************************
 
19
/**************************************************//**
 
20
@file include/mem0dbg.h
20
21
The memory management: the debug code. This is not a compilation module,
21
22
but is included in mem0mem.* !
22
23
 
47
48
#endif
48
49
 
49
50
#if defined UNIV_MEM_DEBUG || defined UNIV_DEBUG
50
 
/*******************************************************************
 
51
/***************************************************************//**
51
52
Checks a memory heap for consistency and prints the contents if requested.
52
53
Outputs the sum of sizes of buffers given to the user (only in
53
54
the debug version), the physical size of the heap and the number of
57
58
void
58
59
mem_heap_validate_or_print(
59
60
/*=======================*/
60
 
        mem_heap_t*     heap,   /* in: memory heap */
61
 
        byte*           top,    /* in: calculate and validate only until
 
61
        mem_heap_t*     heap,   /*!< in: memory heap */
 
62
        byte*           top,    /*!< in: calculate and validate only until
62
63
                                this top pointer in the heap is reached,
63
64
                                if this pointer is NULL, ignored */
64
 
        ibool            print,  /* in: if TRUE, prints the contents
 
65
        ibool            print,  /*!< in: if TRUE, prints the contents
65
66
                                of the heap; works only in
66
67
                                the debug version */
67
 
        ibool*           error,  /* out: TRUE if error */
68
 
        ulint*          us_size,/* out: allocated memory
 
68
        ibool*           error,  /*!< out: TRUE if error */
 
69
        ulint*          us_size,/*!< out: allocated memory
69
70
                                (for the user) in the heap,
70
71
                                if a NULL pointer is passed as this
71
72
                                argument, it is ignored; in the
72
73
                                non-debug version this is always -1 */
73
 
        ulint*          ph_size,/* out: physical size of the heap,
74
 
                                if a NULL pointer is passed as this
75
 
                                argument, it is ignored */
76
 
        ulint*          n_blocks); /* out: number of blocks in the heap,
77
 
                                if a NULL pointer is passed as this
78
 
                                argument, it is ignored */
79
 
/******************************************************************
80
 
Validates the contents of a memory heap. */
 
74
        ulint*          ph_size,/*!< out: physical size of the heap,
 
75
                                if a NULL pointer is passed as this
 
76
                                argument, it is ignored */
 
77
        ulint*          n_blocks); /*!< out: number of blocks in the heap,
 
78
                                if a NULL pointer is passed as this
 
79
                                argument, it is ignored */
 
80
/**************************************************************//**
 
81
Validates the contents of a memory heap.
 
82
@return TRUE if ok */
81
83
UNIV_INTERN
82
84
ibool
83
85
mem_heap_validate(
84
86
/*==============*/
85
 
                                /* out: TRUE if ok */
86
 
        mem_heap_t*   heap);    /* in: memory heap */
 
87
        mem_heap_t*   heap);    /*!< in: memory heap */
87
88
#endif /* UNIV_MEM_DEBUG || UNIV_DEBUG */
88
89
#ifdef UNIV_DEBUG
89
 
/******************************************************************
90
 
Checks that an object is a memory heap (or a block of it) */
 
90
/**************************************************************//**
 
91
Checks that an object is a memory heap (or a block of it)
 
92
@return TRUE if ok */
91
93
UNIV_INTERN
92
94
ibool
93
95
mem_heap_check(
94
96
/*===========*/
95
 
                                /* out: TRUE if ok */
96
 
        mem_heap_t*   heap);    /* in: memory heap */
 
97
        mem_heap_t*   heap);    /*!< in: memory heap */
97
98
#endif /* UNIV_DEBUG */
98
99
#ifdef UNIV_MEM_DEBUG
99
 
/*********************************************************************
100
 
TRUE if no memory is currently allocated. */
 
100
/*****************************************************************//**
 
101
TRUE if no memory is currently allocated.
 
102
@return TRUE if no heaps exist */
101
103
UNIV_INTERN
102
104
ibool
103
105
mem_all_freed(void);
104
106
/*===============*/
105
 
                        /* out: TRUE if no heaps exist */
106
 
/*********************************************************************
107
 
Validates the dynamic memory */
 
107
/*****************************************************************//**
 
108
Validates the dynamic memory
 
109
@return TRUE if error */
108
110
UNIV_INTERN
109
111
ibool
110
112
mem_validate_no_assert(void);
111
113
/*=========================*/
112
 
                        /* out: TRUE if error */
113
 
/****************************************************************
114
 
Validates the dynamic memory */
 
114
/************************************************************//**
 
115
Validates the dynamic memory
 
116
@return TRUE if ok */
115
117
UNIV_INTERN
116
118
ibool
117
119
mem_validate(void);
118
120
/*===============*/
119
 
                        /* out: TRUE if ok */
120
121
#endif /* UNIV_MEM_DEBUG */
121
 
/****************************************************************
 
122
/************************************************************//**
122
123
Tries to find neigboring memory allocation blocks and dumps to stderr
123
124
the neighborhood of a given pointer. */
124
125
UNIV_INTERN
125
126
void
126
127
mem_analyze_corruption(
127
128
/*===================*/
128
 
        void*   ptr);   /* in: pointer to place of possible corruption */
129
 
/*********************************************************************
 
129
        void*   ptr);   /*!< in: pointer to place of possible corruption */
 
130
/*****************************************************************//**
130
131
Prints information of dynamic memory usage and currently allocated memory
131
132
heaps or buffers. Can only be used in the debug version. */
132
133
UNIV_INTERN
133
134
void
134
135
mem_print_info(void);
135
136
/*================*/
136
 
/*********************************************************************
 
137
/*****************************************************************//**
137
138
Prints information of dynamic memory usage and currently allocated memory
138
139
heaps or buffers since the last ..._print_info or..._print_new_info. */
139
140
UNIV_INTERN