~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/mem0dbg.ic

  • Committer: Monty Taylor
  • Date: 2008-11-16 05:36:13 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116053613-bld4rqxhlkb49c02
Split out cache_row and type_holder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
/********************************************************************//**
20
 
@file include/mem0dbg.ic
21
 
The memory management: the debug code. This is not an independent
22
 
compilation module but is included in mem0mem.*.
23
 
 
24
 
Created 6/8/1994 Heikki Tuuri
25
 
*************************************************************************/
26
 
 
27
 
#ifdef UNIV_MEM_DEBUG
28
 
extern ulint    mem_current_allocated_memory;
29
 
 
30
 
/******************************************************************//**
31
 
Initializes an allocated memory field in the debug version. */
32
 
UNIV_INTERN
33
 
void
34
 
mem_field_init(
35
 
/*===========*/
36
 
        byte*   buf,    /*!< in: memory field */
37
 
        ulint   n);     /*!< in: how many bytes the user requested */
38
 
/******************************************************************//**
39
 
Erases an allocated memory field in the debug version. */
40
 
UNIV_INTERN
41
 
void
42
 
mem_field_erase(
43
 
/*============*/
44
 
        byte*   buf,    /*!< in: memory field */
45
 
        ulint   n);     /*!< in: how many bytes the user requested */
46
 
/***************************************************************//**
47
 
Initializes a buffer to a random combination of hex BA and BE.
48
 
Used to initialize allocated memory. */
49
 
UNIV_INTERN
50
 
void
51
 
mem_init_buf(
52
 
/*=========*/
53
 
        byte*   buf,    /*!< in: pointer to buffer */
54
 
        ulint    n);     /*!< in: length of buffer */
55
 
/***************************************************************//**
56
 
Initializes a buffer to a random combination of hex DE and AD.
57
 
Used to erase freed memory. */
58
 
UNIV_INTERN
59
 
void
60
 
mem_erase_buf(
61
 
/*==========*/
62
 
        byte*   buf,    /*!< in: pointer to buffer */
63
 
        ulint   n);     /*!< in: length of buffer */
64
 
/***************************************************************//**
65
 
Inserts a created memory heap to the hash table of
66
 
current allocated memory heaps.
67
 
Initializes the hash table when first called. */
68
 
UNIV_INTERN
69
 
void
70
 
mem_hash_insert(
71
 
/*============*/
72
 
        mem_heap_t*     heap,      /*!< in: the created heap */
73
 
        const char*     file_name, /*!< in: file name of creation */
74
 
        ulint           line);     /*!< in: line where created */
75
 
/***************************************************************//**
76
 
Removes a memory heap (which is going to be freed by the caller)
77
 
from the list of live memory heaps. Returns the size of the heap
78
 
in terms of how much memory in bytes was allocated for the user of
79
 
the heap (not the total space occupied by the heap).
80
 
Also validates the heap.
81
 
NOTE: This function does not free the storage occupied by the
82
 
heap itself, only the node in the list of heaps. */
83
 
UNIV_INTERN
84
 
void
85
 
mem_hash_remove(
86
 
/*============*/
87
 
        mem_heap_t*     heap,      /*!< in: the heap to be freed */
88
 
        const char*     file_name, /*!< in: file name of freeing */
89
 
        ulint           line);     /*!< in: line where freed */
90
 
 
91
 
 
92
 
void
93
 
mem_field_header_set_len(byte* field, ulint len);
94
 
 
95
 
ulint
96
 
mem_field_header_get_len(byte* field);
97
 
 
98
 
void
99
 
mem_field_header_set_check(byte* field, ulint check);
100
 
 
101
 
ulint
102
 
mem_field_header_get_check(byte* field);
103
 
 
104
 
void
105
 
mem_field_trailer_set_check(byte* field, ulint check);
106
 
 
107
 
ulint
108
 
mem_field_trailer_get_check(byte* field);
109
 
#endif /* UNIV_MEM_DEBUG */