~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/univ.i

  • Committer: Brian Aker
  • Date: 2008-09-04 16:50:21 UTC
  • Revision ID: brian@tangent.org-20080904165021-490cv76yapesybd8
Removed duplicate C99/posix calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
#ifndef univ_i
10
10
#define univ_i
11
11
 
12
 
#define INNODB_VERSION_MAJOR    1
13
 
#define INNODB_VERSION_MINOR    0
14
 
#define INNODB_VERSION_BUGFIX   1
15
 
 
16
 
/* The following is the InnoDB version as shown in
17
 
SELECT plugin_version FROM information_schema.plugins;
18
 
calculated in in make_version_string() in sql/sql_show.cc like this:
19
 
"version >> 8" . "version & 0xff"
20
 
because the version is shown with only one dot, we skip the last
21
 
component, i.e. we show M.N.P as M.N */
22
 
#define INNODB_VERSION_SHORT    \
23
 
        (INNODB_VERSION_MAJOR << 8 | INNODB_VERSION_MINOR)
24
 
 
25
 
/* auxiliary macros to help creating the version as string */
26
 
#define __INNODB_VERSION(a, b, c)       (#a "." #b "." #c)
27
 
#define _INNODB_VERSION(a, b, c)        __INNODB_VERSION(a, b, c)
28
 
 
29
 
#define INNODB_VERSION_STR                      \
30
 
        _INNODB_VERSION(INNODB_VERSION_MAJOR,   \
31
 
                        INNODB_VERSION_MINOR,   \
32
 
                        INNODB_VERSION_BUGFIX)
33
 
 
34
 
#ifdef MYSQL_DYNAMIC_PLUGIN
35
 
/* In the dynamic plugin, redefine some externally visible symbols
36
 
in order not to conflict with the symbols of a builtin InnoDB. */
37
 
 
38
 
/* Rename all C++ classes that contain virtual functions, because we
39
 
have not figured out how to apply the visibility=hidden attribute to
40
 
the virtual method table (vtable) in GCC 3. */
41
 
# define ha_innobase ha_innodb
42
 
#endif /* MYSQL_DYNAMIC_PLUGIN */
43
 
 
44
 
#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(MYSQL_SERVER) && !defined(__WIN__)
 
12
#if (defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)) && !defined(DRIZZLE_SERVER) && !defined(__WIN__)
45
13
# undef __WIN__
46
14
# define __WIN__
47
15
 
62
30
in compiling more Posix-compatible. These headers also define __WIN__
63
31
if we are compiling on Windows. */
64
32
 
65
 
# if defined(BUILD_DRIZZLE)
66
 
#  include <drizzled/global.h>
67
 
#  include <mysys/my_pthread.h>
68
 
# else
69
 
#  include <my_global.h>
70
 
#  include <my_pthread.h>
71
 
# endif
 
33
# include <drizzled/global.h>
 
34
# include <mysys/my_pthread.h>
72
35
 
73
36
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
74
37
# include <sys/stat.h>
75
 
# if !defined(__NETWARE__) && !defined(__WIN__) 
76
 
#  include <sys/mman.h> /* mmap() for os0proc.c */
77
 
# endif
78
38
 
79
39
# undef PACKAGE
80
40
# undef VERSION
81
41
 
82
42
/* Include the header file generated by GNU autoconf */
83
43
# ifndef __WIN__
84
 
#  include <config.h>
 
44
#  include "config.h"
85
45
# endif
86
46
 
87
47
# ifdef HAVE_SCHED_H
120
80
#define UNIV_INIT_MEM_TO_ZERO
121
81
*/
122
82
 
123
 
/* When this macro is defined then additional test functions will be
124
 
compiled. These functions live at the end of each relevant source file
125
 
and have "test_" prefix. These functions are not called from anywhere in
126
 
the code, they can be called from gdb after
127
 
innobase_start_or_create_for_mysql() has executed using the call
128
 
command. Not tested on Windows. */
129
 
/*
130
 
#define UNIV_COMPILE_TEST_FUNCS
131
 
*/
 
83
/* Make a non-inline debug version */
132
84
 
133
85
#if 0
134
86
#define UNIV_DEBUG_VALGRIND                     /* Enable extra
135
87
                                                Valgrind instrumentation */
136
 
#define UNIV_DEBUG_PRINT                        /* Enable the compilation of
137
 
                                                some debug print functions */
138
 
#define UNIV_BUF_DEBUG                          /* Enable buffer pool
139
 
                                                debugging without UNIV_DEBUG */
140
 
#define UNIV_DEBUG                              /* Enable ut_ad() assertions
141
 
                                                and disable UNIV_INLINE */
142
 
#define UNIV_DEBUG_FILE_ACCESSES                /* Debug .ibd file access
143
 
                                                (field file_page_was_freed
144
 
                                                in buf_page_t) */
145
 
#define UNIV_HASH_DEBUG                         /* debug HASH_ macros */
 
88
#define UNIV_DEBUG                              /* Enable ut_ad() assertions */
146
89
#define UNIV_LIST_DEBUG                         /* debug UT_LIST_ macros */
147
90
#define UNIV_MEM_DEBUG                          /* detect memory leaks etc */
148
 
#define UNIV_IBUF_DEBUG                         /* debug the insert buffer */
149
 
#define UNIV_IBUF_COUNT_DEBUG                   /* debug the insert buffer;
 
91
#define UNIV_IBUF_DEBUG                         /* debug the insert buffer;
150
92
this limits the database to IBUF_COUNT_N_SPACES and IBUF_COUNT_N_PAGES,
151
93
and the insert buffer must be empty when the database is started */
152
94
#define UNIV_SYNC_DEBUG                         /* debug mutex and latch
160
102
                                                in sync0sync.c */
161
103
#define UNIV_BTR_PRINT                          /* enable functions for
162
104
                                                printing B-trees */
163
 
#define UNIV_ZIP_DEBUG                          /* extensive consistency checks
164
 
                                                for compressed pages */
165
105
#endif
166
106
 
167
107
#define UNIV_BTR_DEBUG                          /* check B-tree links */
189
129
                        /* the above option enables basic recovery debugging:
190
130
                        new allocated file pages are reset */
191
131
 
192
 
/* Linkage specifier for non-static InnoDB symbols (variables and functions)
193
 
that are only referenced from within InnoDB, not from MySQL */
194
 
#if defined(HAVE_ATTR_HIDDEN)
195
 
# define UNIV_INTERN __attribute__((visibility ("hidden")))
196
 
#else
197
 
# define UNIV_INTERN
198
 
#endif
199
 
 
200
 
#if (!defined(UNIV_DEBUG) && !defined(UNIV_MUST_NOT_INLINE))
 
132
#if (!defined(UNIV_DEBUG) && !defined(INSIDE_HA_INNOBASE_CC) && !defined(UNIV_MUST_NOT_INLINE))
201
133
/* Definition for inline version */
202
134
 
203
135
#ifdef __WIN__
211
143
definitions: */
212
144
 
213
145
#define UNIV_NONINL
214
 
#define UNIV_INLINE     UNIV_INTERN
 
146
#define UNIV_INLINE
215
147
 
216
148
#endif  /* UNIV_DEBUG */
217
149
 
236
168
                        ========================
237
169
*/
238
170
 
 
171
/* The universal page size of the database */
 
172
#define UNIV_PAGE_SIZE          (2 * 8192) /* NOTE! Currently, this has to be a
 
173
                                        power of 2 */
239
174
/* The 2-logarithm of UNIV_PAGE_SIZE: */
240
175
#define UNIV_PAGE_SIZE_SHIFT    14
241
 
/* The universal page size of the database */
242
 
#define UNIV_PAGE_SIZE          (1 << UNIV_PAGE_SIZE_SHIFT)
243
176
 
244
177
/* Maximum number of parallel threads in a parallelized operation */
245
178
#define UNIV_MAX_PARALLELISM    32
278
211
#endif
279
212
 
280
213
#ifdef __WIN__
281
 
typedef __int64                 ib_int64_t;
282
 
typedef unsigned __int64        ib_uint64_t;
 
214
typedef __int64                 ib_longlong;
283
215
#else
284
 
/* Note: longlong and ulonglong come from MySQL headers. */
285
 
# if defined(BUILD_DRIZZLE)
286
 
typedef int64_t                 ib_int64_t;
287
 
typedef uint64_t                ib_uint64_t;
288
 
typedef uint16_t                uint16;
289
 
typedef bool                    my_bool;
290
 
typedef uint32_t                uint32;
291
 
# else
292
 
typedef longlong                ib_int64_t;
293
 
typedef ulonglong               ib_uint64_t;
294
 
#define PRIu64                  "llu"
295
 
# endif // DRIZZLE
 
216
typedef int64_t         ib_longlong;
296
217
#endif
297
218
 
298
 
typedef unsigned long long int  ullint;
 
219
typedef uint64_t        ullint;
299
220
 
300
221
#ifndef __WIN__
301
222
#if SIZEOF_LONG != SIZEOF_VOIDP
312
233
/* Maximum value for a ulint */
313
234
#define ULINT_MAX               ((ulint)(-2))
314
235
 
315
 
/* Maximum value for ib_uint64_t */
316
 
#define IB_ULONGLONG_MAX        ((ib_uint64_t) (~0ULL))
317
 
 
318
236
/* This 'ibool' type is used within Innobase. Remember that different included
319
237
headers may define 'bool' differently. Do not assume that 'bool' is a ulint! */
320
238
#define ibool                   ulint
390
308
# define UNIV_MEM_INVALID(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
391
309
# define UNIV_MEM_FREE(addr, size) VALGRIND_MAKE_MEM_NOACCESS(addr, size)
392
310
# define UNIV_MEM_ALLOC(addr, size) VALGRIND_MAKE_MEM_UNDEFINED(addr, size)
393
 
# define UNIV_MEM_DESC(addr, size, b) VALGRIND_CREATE_BLOCK(addr, size, b)
394
 
# define UNIV_MEM_UNDESC(b) VALGRIND_DISCARD(b)
395
311
# define UNIV_MEM_ASSERT_RW(addr, size) do {                            \
396
312
        const void* _p = (const void*) (ulint)                          \
397
313
                VALGRIND_CHECK_MEM_IS_DEFINED(addr, size);              \
415
331
# define UNIV_MEM_INVALID(addr, size) do {} while(0)
416
332
# define UNIV_MEM_FREE(addr, size) do {} while(0)
417
333
# define UNIV_MEM_ALLOC(addr, size) do {} while(0)
418
 
# define UNIV_MEM_DESC(addr, size, b) do {} while(0)
419
 
# define UNIV_MEM_UNDESC(b) do {} while(0)
420
334
# define UNIV_MEM_ASSERT_RW(addr, size) do {} while(0)
421
335
# define UNIV_MEM_ASSERT_W(addr, size) do {} while(0)
422
336
#endif