InnoDB Plugin  1.0
dyn0dyn.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 1996, 2013, Oracle and/or its affiliates. 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.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
26 #ifndef dyn0dyn_h
27 #define dyn0dyn_h
28 
29 #include "univ.i"
30 #include "ut0lst.h"
31 #include "mem0mem.h"
32 
34 struct dyn_block_t;
36 typedef dyn_block_t dyn_array_t;
37 
40 #define DYN_ARRAY_DATA_SIZE 512
41 
42 /*********************************************************************/
45 UNIV_INLINE
48 /*=============*/
49  dyn_array_t* arr)
51  __attribute__((nonnull));
52 /************************************************************/
54 UNIV_INLINE
55 void
57 /*===========*/
58  dyn_array_t* arr)
59  __attribute__((nonnull));
60 /*********************************************************************/
65 UNIV_INLINE
66 byte*
68 /*===========*/
69  dyn_array_t* arr,
70  ulint size)
72  __attribute__((nonnull, warn_unused_result));
73 /*********************************************************************/
75 UNIV_INLINE
76 void
78 /*============*/
79  dyn_array_t* arr,
80  const byte* ptr)
81  __attribute__((nonnull));
82 /*********************************************************************/
87 UNIV_INLINE
88 void*
90 /*===========*/
91  dyn_array_t* arr,
92  ulint size)
93  __attribute__((nonnull, warn_unused_result));
94 /************************************************************/
97 UNIV_INLINE
98 void*
100 /*==================*/
101  const dyn_array_t* arr,
102  ulint pos)
104  __attribute__((nonnull, warn_unused_result));
105 /************************************************************/
108 UNIV_INLINE
109 ulint
111 /*====================*/
112  const dyn_array_t* arr)
113  __attribute__((nonnull, warn_unused_result, pure));
114 /************************************************************/
118 #define dyn_array_get_first_block(arr) (arr)
119 /************************************************************/
123 #define dyn_array_get_last_block(arr) \
124  ((arr)->heap ? UT_LIST_GET_LAST((arr)->base) : (arr))
125 /********************************************************************/
130 #define dyn_array_get_next_block(arr, block) \
131  ((arr)->heap ? UT_LIST_GET_NEXT(list, block) : NULL)
132 /********************************************************************/
137 #define dyn_array_get_prev_block(arr, block) \
138  ((arr)->heap ? UT_LIST_GET_PREV(list, block) : NULL)
139 /********************************************************************/
142 UNIV_INLINE
143 ulint
145 /*===============*/
146  const dyn_block_t* block)
147  __attribute__((nonnull, warn_unused_result, pure));
148 /********************************************************************/
151 UNIV_INLINE
152 byte*
154 /*===============*/
155  const dyn_block_t* block)
156  __attribute__((nonnull, warn_unused_result, pure));
157 /********************************************************/
159 UNIV_INLINE
160 void
162 /*============*/
163  dyn_array_t* arr,
164  const byte* str,
165  ulint len)
166  __attribute__((nonnull));
167 
168 /*#################################################################*/
169 
173 struct dyn_block_t{
176  ulint used;
181  UT_LIST_BASE_NODE_T(dyn_block_t) base;
184  UT_LIST_NODE_T(dyn_block_t) list;
186 #ifdef UNIV_DEBUG
187  ulint buf_end;
190  ulint magic_n;
191 #endif
192 };
193 
194 
195 #ifndef UNIV_NONINL
196 #include "dyn0dyn.ic"
197 #endif
198 
199 #endif