libmdbx
0.13.2.20 (2024-12-20T11:46:01+03:00)
One of the fastest compact embeddable key-value ACID storage engine without WAL.
Loading...
Searching...
No Matches
options.h
Go to the documentation of this file.
1
3
4
/*******************************************************************************
5
*******************************************************************************
6
*
7
* BUILD TIME
8
*
9
* #### ##### ##### # #### # # ####
10
* # # # # # # # # ## # #
11
* # # # # # # # # # # # ####
12
* # # ##### # # # # # # # #
13
* # # # # # # # # ## # #
14
* #### # # # #### # # ####
15
*
16
*
17
*/
18
19
#pragma once
20
21
#include "essentials.h"
22
28
#define MDBX_OSX_WANNA_DURABILITY 0
30
#define MDBX_OSX_WANNA_SPEED 1
31
32
#ifndef MDBX_APPLE_SPEED_INSTEADOF_DURABILITY
35
#define MDBX_APPLE_SPEED_INSTEADOF_DURABILITY MDBX_OSX_WANNA_DURABILITY
36
#endif
/* MDBX_APPLE_SPEED_INSTEADOF_DURABILITY */
37
39
#ifndef MDBX_ENV_CHECKPID
40
#if defined(MADV_DONTFORK) || defined(_WIN32) || defined(_WIN64)
41
/* PID check could be omitted:
42
* - on Linux when madvise(MADV_DONTFORK) is available, i.e. after the fork()
43
* mapped pages will not be available for child process.
44
* - in Windows where fork() not available. */
45
#define MDBX_ENV_CHECKPID 0
46
#else
47
#define MDBX_ENV_CHECKPID 1
48
#endif
49
#define MDBX_ENV_CHECKPID_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_ENV_CHECKPID)
50
#elif !(MDBX_ENV_CHECKPID == 0 || MDBX_ENV_CHECKPID == 1)
51
#error MDBX_ENV_CHECKPID must be defined as 0 or 1
52
#else
53
#define MDBX_ENV_CHECKPID_CONFIG MDBX_STRINGIFY(MDBX_ENV_CHECKPID)
54
#endif
/* MDBX_ENV_CHECKPID */
55
58
#ifndef MDBX_TXN_CHECKOWNER
59
#define MDBX_TXN_CHECKOWNER 1
60
#define MDBX_TXN_CHECKOWNER_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_TXN_CHECKOWNER)
61
#elif !(MDBX_TXN_CHECKOWNER == 0 || MDBX_TXN_CHECKOWNER == 1)
62
#error MDBX_TXN_CHECKOWNER must be defined as 0 or 1
63
#else
64
#define MDBX_TXN_CHECKOWNER_CONFIG MDBX_STRINGIFY(MDBX_TXN_CHECKOWNER)
65
#endif
/* MDBX_TXN_CHECKOWNER */
66
68
#ifndef MDBX_TRUST_RTC
69
#if defined(__linux__) || defined(__gnu_linux__) || defined(__NetBSD__) || defined(__OpenBSD__)
70
#define MDBX_TRUST_RTC 0
/* a lot of embedded systems have a fake RTC */
71
#else
72
#define MDBX_TRUST_RTC 1
73
#endif
74
#define MDBX_TRUST_RTC_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_TRUST_RTC)
75
#elif !(MDBX_TRUST_RTC == 0 || MDBX_TRUST_RTC == 1)
76
#error MDBX_TRUST_RTC must be defined as 0 or 1
77
#else
78
#define MDBX_TRUST_RTC_CONFIG MDBX_STRINGIFY(MDBX_TRUST_RTC)
79
#endif
/* MDBX_TRUST_RTC */
80
82
#ifndef MDBX_ENABLE_REFUND
83
#define MDBX_ENABLE_REFUND 1
84
#elif !(MDBX_ENABLE_REFUND == 0 || MDBX_ENABLE_REFUND == 1)
85
#error MDBX_ENABLE_REFUND must be defined as 0 or 1
86
#endif
/* MDBX_ENABLE_REFUND */
87
89
#ifndef MDBX_ENABLE_PROFGC
90
#define MDBX_ENABLE_PROFGC 0
91
#elif !(MDBX_ENABLE_PROFGC == 0 || MDBX_ENABLE_PROFGC == 1)
92
#error MDBX_ENABLE_PROFGC must be defined as 0 or 1
93
#endif
/* MDBX_ENABLE_PROFGC */
94
96
#ifndef MDBX_ENABLE_PGOP_STAT
97
#define MDBX_ENABLE_PGOP_STAT 1
98
#elif !(MDBX_ENABLE_PGOP_STAT == 0 || MDBX_ENABLE_PGOP_STAT == 1)
99
#error MDBX_ENABLE_PGOP_STAT must be defined as 0 or 1
100
#endif
/* MDBX_ENABLE_PGOP_STAT */
101
104
#ifndef MDBX_USE_MINCORE
105
#if defined(MINCORE_INCORE) || !(defined(_WIN32) || defined(_WIN64))
106
#define MDBX_USE_MINCORE 1
107
#else
108
#define MDBX_USE_MINCORE 0
109
#endif
110
#define MDBX_USE_MINCORE_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_USE_MINCORE)
111
#elif !(MDBX_USE_MINCORE == 0 || MDBX_USE_MINCORE == 1)
112
#error MDBX_USE_MINCORE must be defined as 0 or 1
113
#endif
/* MDBX_USE_MINCORE */
114
117
#ifndef MDBX_ENABLE_BIGFOOT
118
#define MDBX_ENABLE_BIGFOOT 1
119
#elif !(MDBX_ENABLE_BIGFOOT == 0 || MDBX_ENABLE_BIGFOOT == 1)
120
#error MDBX_ENABLE_BIGFOOT must be defined as 0 or 1
121
#endif
/* MDBX_ENABLE_BIGFOOT */
122
125
#ifndef MDBX_DISABLE_VALIDATION
126
#define MDBX_DISABLE_VALIDATION 0
127
#elif !(MDBX_DISABLE_VALIDATION == 0 || MDBX_DISABLE_VALIDATION == 1)
128
#error MDBX_DISABLE_VALIDATION must be defined as 0 or 1
129
#endif
/* MDBX_DISABLE_VALIDATION */
130
131
#ifndef MDBX_PNL_PREALLOC_FOR_RADIXSORT
132
#define MDBX_PNL_PREALLOC_FOR_RADIXSORT 1
133
#elif !(MDBX_PNL_PREALLOC_FOR_RADIXSORT == 0 || MDBX_PNL_PREALLOC_FOR_RADIXSORT == 1)
134
#error MDBX_PNL_PREALLOC_FOR_RADIXSORT must be defined as 0 or 1
135
#endif
/* MDBX_PNL_PREALLOC_FOR_RADIXSORT */
136
137
#ifndef MDBX_DPL_PREALLOC_FOR_RADIXSORT
138
#define MDBX_DPL_PREALLOC_FOR_RADIXSORT 1
139
#elif !(MDBX_DPL_PREALLOC_FOR_RADIXSORT == 0 || MDBX_DPL_PREALLOC_FOR_RADIXSORT == 1)
140
#error MDBX_DPL_PREALLOC_FOR_RADIXSORT must be defined as 0 or 1
141
#endif
/* MDBX_DPL_PREALLOC_FOR_RADIXSORT */
142
154
#ifndef MDBX_AVOID_MSYNC
155
#if defined(_WIN32) || defined(_WIN64)
156
#define MDBX_AVOID_MSYNC 1
157
#else
158
#define MDBX_AVOID_MSYNC 0
159
#endif
160
#elif !(MDBX_AVOID_MSYNC == 0 || MDBX_AVOID_MSYNC == 1)
161
#error MDBX_AVOID_MSYNC must be defined as 0 or 1
162
#endif
/* MDBX_AVOID_MSYNC */
163
166
#ifndef MDBX_ENABLE_DBI_SPARSE
167
#define MDBX_ENABLE_DBI_SPARSE 1
168
#elif !(MDBX_ENABLE_DBI_SPARSE == 0 || MDBX_ENABLE_DBI_SPARSE == 1)
169
#error MDBX_ENABLE_DBI_SPARSE must be defined as 0 or 1
170
#endif
/* MDBX_ENABLE_DBI_SPARSE */
171
174
#ifndef MDBX_ENABLE_DBI_LOCKFREE
175
#define MDBX_ENABLE_DBI_LOCKFREE 1
176
#elif !(MDBX_ENABLE_DBI_LOCKFREE == 0 || MDBX_ENABLE_DBI_LOCKFREE == 1)
177
#error MDBX_ENABLE_DBI_LOCKFREE must be defined as 0 or 1
178
#endif
/* MDBX_ENABLE_DBI_LOCKFREE */
179
184
#ifndef MDBX_PNL_ASCENDING
185
#define MDBX_PNL_ASCENDING 0
186
#elif !(MDBX_PNL_ASCENDING == 0 || MDBX_PNL_ASCENDING == 1)
187
#error MDBX_PNL_ASCENDING must be defined as 0 or 1
188
#endif
/* MDBX_PNL_ASCENDING */
189
191
#ifndef MDBX_WITHOUT_MSVC_CRT
192
#if defined(MDBX_BUILD_CXX) && !MDBX_BUILD_CXX
193
#define MDBX_WITHOUT_MSVC_CRT 1
194
#else
195
#define MDBX_WITHOUT_MSVC_CRT 0
196
#endif
197
#elif !(MDBX_WITHOUT_MSVC_CRT == 0 || MDBX_WITHOUT_MSVC_CRT == 1)
198
#error MDBX_WITHOUT_MSVC_CRT must be defined as 0 or 1
199
#endif
/* MDBX_WITHOUT_MSVC_CRT */
200
202
#ifndef MDBX_ENVCOPY_WRITEBUF
203
#define MDBX_ENVCOPY_WRITEBUF 1048576u
204
#elif MDBX_ENVCOPY_WRITEBUF < 65536u || MDBX_ENVCOPY_WRITEBUF > 1073741824u || MDBX_ENVCOPY_WRITEBUF % 65536u
205
#error MDBX_ENVCOPY_WRITEBUF must be defined in range 65536..1073741824 and be multiple of 65536
206
#endif
/* MDBX_ENVCOPY_WRITEBUF */
207
209
#ifndef MDBX_FORCE_ASSERTIONS
210
#define MDBX_FORCE_ASSERTIONS 0
211
#elif !(MDBX_FORCE_ASSERTIONS == 0 || MDBX_FORCE_ASSERTIONS == 1)
212
#error MDBX_FORCE_ASSERTIONS must be defined as 0 or 1
213
#endif
/* MDBX_FORCE_ASSERTIONS */
214
217
#ifndef MDBX_ASSUME_MALLOC_OVERHEAD
218
#ifdef __SIZEOF_POINTER__
219
#define MDBX_ASSUME_MALLOC_OVERHEAD (__SIZEOF_POINTER__ * 2u)
220
#else
221
#define MDBX_ASSUME_MALLOC_OVERHEAD (sizeof(void *) * 2u)
222
#endif
223
#elif MDBX_ASSUME_MALLOC_OVERHEAD < 0 || MDBX_ASSUME_MALLOC_OVERHEAD > 64 || MDBX_ASSUME_MALLOC_OVERHEAD % 4
224
#error MDBX_ASSUME_MALLOC_OVERHEAD must be defined in range 0..64 and be multiple of 4
225
#endif
/* MDBX_ASSUME_MALLOC_OVERHEAD */
226
229
#ifndef ENABLE_MEMCHECK
230
#endif
/* ENABLE_MEMCHECK */
231
234
#ifndef MDBX_HAVE_C11ATOMICS
235
#endif
/* MDBX_HAVE_C11ATOMICS */
236
243
#ifndef MDBX_HAVE_BUILTIN_CPU_SUPPORTS
244
#if defined(__APPLE__) || defined(BIONIC)
245
/* Never use any modern features on Apple's or Google's OSes
246
* since a lot of troubles with compatibility and/or performance */
247
#define MDBX_HAVE_BUILTIN_CPU_SUPPORTS 0
248
#elif defined(__e2k__)
249
#define MDBX_HAVE_BUILTIN_CPU_SUPPORTS 0
250
#elif __has_builtin(__builtin_cpu_supports) || defined(__BUILTIN_CPU_SUPPORTS__) || \
251
(defined(__ia32__) && __GNUC_PREREQ(4, 8) && __GLIBC_PREREQ(2, 23))
252
#define MDBX_HAVE_BUILTIN_CPU_SUPPORTS 1
253
#else
254
#define MDBX_HAVE_BUILTIN_CPU_SUPPORTS 0
255
#endif
256
#elif !(MDBX_HAVE_BUILTIN_CPU_SUPPORTS == 0 || MDBX_HAVE_BUILTIN_CPU_SUPPORTS == 1)
257
#error MDBX_HAVE_BUILTIN_CPU_SUPPORTS must be defined as 0 or 1
258
#endif
/* MDBX_HAVE_BUILTIN_CPU_SUPPORTS */
259
260
//------------------------------------------------------------------------------
261
263
#define MDBX_LOCKING_WIN32FILES -1
264
266
#define MDBX_LOCKING_SYSV 5
267
269
#define MDBX_LOCKING_POSIX1988 1988
270
272
#define MDBX_LOCKING_POSIX2001 2001
273
275
#define MDBX_LOCKING_POSIX2008 2008
276
278
#if defined(_WIN32) || defined(_WIN64)
279
#define MDBX_LOCKING MDBX_LOCKING_WIN32FILES
280
#else
281
#ifndef MDBX_LOCKING
282
#if defined(_POSIX_THREAD_PROCESS_SHARED) && _POSIX_THREAD_PROCESS_SHARED >= 200112L && !defined(__FreeBSD__)
283
284
/* Some platforms define the EOWNERDEAD error code even though they
285
* don't support Robust Mutexes. If doubt compile with -MDBX_LOCKING=2001. */
286
#if defined(EOWNERDEAD) && _POSIX_THREAD_PROCESS_SHARED >= 200809L && \
287
((defined(_POSIX_THREAD_ROBUST_PRIO_INHERIT) && _POSIX_THREAD_ROBUST_PRIO_INHERIT > 0) || \
288
(defined(_POSIX_THREAD_ROBUST_PRIO_PROTECT) && _POSIX_THREAD_ROBUST_PRIO_PROTECT > 0) || \
289
defined(PTHREAD_MUTEX_ROBUST) || defined(PTHREAD_MUTEX_ROBUST_NP)) && \
290
(!defined(__GLIBC__) || __GLIBC_PREREQ(2, 10)
/* troubles with Robust mutexes before 2.10 */
)
291
#define MDBX_LOCKING MDBX_LOCKING_POSIX2008
292
#else
293
#define MDBX_LOCKING MDBX_LOCKING_POSIX2001
294
#endif
295
#elif defined(__sun) || defined(__SVR4) || defined(__svr4__)
296
#define MDBX_LOCKING MDBX_LOCKING_POSIX1988
297
#else
298
#define MDBX_LOCKING MDBX_LOCKING_SYSV
299
#endif
300
#define MDBX_LOCKING_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_LOCKING)
301
#else
302
#define MDBX_LOCKING_CONFIG MDBX_STRINGIFY(MDBX_LOCKING)
303
#endif
/* MDBX_LOCKING */
304
#endif
/* !Windows */
305
307
#ifndef MDBX_USE_OFDLOCKS
308
#if ((defined(F_OFD_SETLK) && defined(F_OFD_SETLKW) && defined(F_OFD_GETLK)) || \
309
(defined(F_OFD_SETLK64) && defined(F_OFD_SETLKW64) && defined(F_OFD_GETLK64))) && \
310
!defined(MDBX_SAFE4QEMU) && !defined(__sun)
/* OFD-lock are broken on Solaris */
311
#define MDBX_USE_OFDLOCKS 1
312
#else
313
#define MDBX_USE_OFDLOCKS 0
314
#endif
315
#define MDBX_USE_OFDLOCKS_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_USE_OFDLOCKS)
316
#elif !(MDBX_USE_OFDLOCKS == 0 || MDBX_USE_OFDLOCKS == 1)
317
#error MDBX_USE_OFDLOCKS must be defined as 0 or 1
318
#else
319
#define MDBX_USE_OFDLOCKS_CONFIG MDBX_STRINGIFY(MDBX_USE_OFDLOCKS)
320
#endif
/* MDBX_USE_OFDLOCKS */
321
323
#ifndef MDBX_USE_SENDFILE
324
#if ((defined(__linux__) || defined(__gnu_linux__)) && !defined(__ANDROID_API__)) || \
325
(defined(__ANDROID_API__) && __ANDROID_API__ >= 21)
326
#define MDBX_USE_SENDFILE 1
327
#else
328
#define MDBX_USE_SENDFILE 0
329
#endif
330
#elif !(MDBX_USE_SENDFILE == 0 || MDBX_USE_SENDFILE == 1)
331
#error MDBX_USE_SENDFILE must be defined as 0 or 1
332
#endif
/* MDBX_USE_SENDFILE */
333
335
#ifndef MDBX_USE_COPYFILERANGE
336
#if __GLIBC_PREREQ(2, 27) && defined(_GNU_SOURCE)
337
#define MDBX_USE_COPYFILERANGE 1
338
#else
339
#define MDBX_USE_COPYFILERANGE 0
340
#endif
341
#elif !(MDBX_USE_COPYFILERANGE == 0 || MDBX_USE_COPYFILERANGE == 1)
342
#error MDBX_USE_COPYFILERANGE must be defined as 0 or 1
343
#endif
/* MDBX_USE_COPYFILERANGE */
344
345
//------------------------------------------------------------------------------
346
347
#ifndef MDBX_CPU_WRITEBACK_INCOHERENT
348
#if defined(__ia32__) || defined(__e2k__) || defined(__hppa) || defined(__hppa__) || defined(DOXYGEN)
349
#define MDBX_CPU_WRITEBACK_INCOHERENT 0
350
#else
351
#define MDBX_CPU_WRITEBACK_INCOHERENT 1
352
#endif
353
#elif !(MDBX_CPU_WRITEBACK_INCOHERENT == 0 || MDBX_CPU_WRITEBACK_INCOHERENT == 1)
354
#error MDBX_CPU_WRITEBACK_INCOHERENT must be defined as 0 or 1
355
#endif
/* MDBX_CPU_WRITEBACK_INCOHERENT */
356
357
#ifndef MDBX_MMAP_INCOHERENT_FILE_WRITE
358
#ifdef __OpenBSD__
359
#define MDBX_MMAP_INCOHERENT_FILE_WRITE 1
360
#else
361
#define MDBX_MMAP_INCOHERENT_FILE_WRITE 0
362
#endif
363
#elif !(MDBX_MMAP_INCOHERENT_FILE_WRITE == 0 || MDBX_MMAP_INCOHERENT_FILE_WRITE == 1)
364
#error MDBX_MMAP_INCOHERENT_FILE_WRITE must be defined as 0 or 1
365
#endif
/* MDBX_MMAP_INCOHERENT_FILE_WRITE */
366
367
#ifndef MDBX_MMAP_INCOHERENT_CPU_CACHE
368
#if defined(__mips) || defined(__mips__) || defined(__mips64) || defined(__mips64__) || defined(_M_MRX000) || \
369
defined(_MIPS_) || defined(__MWERKS__) || defined(__sgi)
370
/* MIPS has cache coherency issues. */
371
#define MDBX_MMAP_INCOHERENT_CPU_CACHE 1
372
#else
373
/* LY: assume no relevant mmap/dcache issues. */
374
#define MDBX_MMAP_INCOHERENT_CPU_CACHE 0
375
#endif
376
#elif !(MDBX_MMAP_INCOHERENT_CPU_CACHE == 0 || MDBX_MMAP_INCOHERENT_CPU_CACHE == 1)
377
#error MDBX_MMAP_INCOHERENT_CPU_CACHE must be defined as 0 or 1
378
#endif
/* MDBX_MMAP_INCOHERENT_CPU_CACHE */
379
382
#ifndef MDBX_MMAP_NEEDS_JOLT
383
#if MDBX_MMAP_INCOHERENT_FILE_WRITE || MDBX_MMAP_INCOHERENT_CPU_CACHE || !(defined(__linux__) || defined(__gnu_linux__))
384
#define MDBX_MMAP_NEEDS_JOLT 1
385
#else
386
#define MDBX_MMAP_NEEDS_JOLT 0
387
#endif
388
#define MDBX_MMAP_NEEDS_JOLT_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_MMAP_NEEDS_JOLT)
389
#elif !(MDBX_MMAP_NEEDS_JOLT == 0 || MDBX_MMAP_NEEDS_JOLT == 1)
390
#error MDBX_MMAP_NEEDS_JOLT must be defined as 0 or 1
391
#endif
/* MDBX_MMAP_NEEDS_JOLT */
392
393
#ifndef MDBX_64BIT_ATOMIC
394
#if MDBX_WORDBITS >= 64 || defined(DOXYGEN)
395
#define MDBX_64BIT_ATOMIC 1
396
#else
397
#define MDBX_64BIT_ATOMIC 0
398
#endif
399
#define MDBX_64BIT_ATOMIC_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_64BIT_ATOMIC)
400
#elif !(MDBX_64BIT_ATOMIC == 0 || MDBX_64BIT_ATOMIC == 1)
401
#error MDBX_64BIT_ATOMIC must be defined as 0 or 1
402
#else
403
#define MDBX_64BIT_ATOMIC_CONFIG MDBX_STRINGIFY(MDBX_64BIT_ATOMIC)
404
#endif
/* MDBX_64BIT_ATOMIC */
405
406
#ifndef MDBX_64BIT_CAS
407
#if defined(__GCC_ATOMIC_LLONG_LOCK_FREE)
408
#if __GCC_ATOMIC_LLONG_LOCK_FREE > 1
409
#define MDBX_64BIT_CAS 1
410
#else
411
#define MDBX_64BIT_CAS 0
412
#endif
413
#elif defined(__CLANG_ATOMIC_LLONG_LOCK_FREE)
414
#if __CLANG_ATOMIC_LLONG_LOCK_FREE > 1
415
#define MDBX_64BIT_CAS 1
416
#else
417
#define MDBX_64BIT_CAS 0
418
#endif
419
#elif defined(ATOMIC_LLONG_LOCK_FREE)
420
#if ATOMIC_LLONG_LOCK_FREE > 1
421
#define MDBX_64BIT_CAS 1
422
#else
423
#define MDBX_64BIT_CAS 0
424
#endif
425
#elif defined(_MSC_VER) || defined(__APPLE__) || defined(DOXYGEN)
426
#define MDBX_64BIT_CAS 1
427
#elif !(MDBX_64BIT_CAS == 0 || MDBX_64BIT_CAS == 1)
428
#error MDBX_64BIT_CAS must be defined as 0 or 1
429
#else
430
#define MDBX_64BIT_CAS MDBX_64BIT_ATOMIC
431
#endif
432
#define MDBX_64BIT_CAS_CONFIG "AUTO=" MDBX_STRINGIFY(MDBX_64BIT_CAS)
433
#else
434
#define MDBX_64BIT_CAS_CONFIG MDBX_STRINGIFY(MDBX_64BIT_CAS)
435
#endif
/* MDBX_64BIT_CAS */
436
437
#ifndef MDBX_UNALIGNED_OK
438
#if defined(__ALIGNED__) || defined(__SANITIZE_UNDEFINED__) || defined(ENABLE_UBSAN)
439
#define MDBX_UNALIGNED_OK 0
/* no unaligned access allowed */
440
#elif defined(__ARM_FEATURE_UNALIGNED)
441
#define MDBX_UNALIGNED_OK 4
/* ok unaligned for 32-bit words */
442
#elif defined(__e2k__) || defined(__elbrus__)
443
#if __iset__ > 4
444
#define MDBX_UNALIGNED_OK 8
/* ok unaligned for 64-bit words */
445
#else
446
#define MDBX_UNALIGNED_OK 4
/* ok unaligned for 32-bit words */
447
#endif
448
#elif defined(__ia32__)
449
#define MDBX_UNALIGNED_OK 8
/* ok unaligned for 64-bit words */
450
#elif __CLANG_PREREQ(5, 0) || __GNUC_PREREQ(5, 0)
451
/* expecting an optimization will well done, also this
452
* hushes false-positives from UBSAN (undefined behaviour sanitizer) */
453
#define MDBX_UNALIGNED_OK 0
454
#else
455
#define MDBX_UNALIGNED_OK 0
/* no unaligned access allowed */
456
#endif
457
#elif MDBX_UNALIGNED_OK == 1
458
#undef MDBX_UNALIGNED_OK
459
#define MDBX_UNALIGNED_OK 32
/* any unaligned access allowed */
460
#endif
/* MDBX_UNALIGNED_OK */
461
462
#ifndef MDBX_CACHELINE_SIZE
463
#if defined(SYSTEM_CACHE_ALIGNMENT_SIZE)
464
#define MDBX_CACHELINE_SIZE SYSTEM_CACHE_ALIGNMENT_SIZE
465
#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64)
466
#define MDBX_CACHELINE_SIZE 128
467
#else
468
#define MDBX_CACHELINE_SIZE 64
469
#endif
470
#endif
/* MDBX_CACHELINE_SIZE */
471
472
/* Max length of iov-vector passed to writev() call, used for auxilary writes */
473
#ifndef MDBX_AUXILARY_IOV_MAX
474
#define MDBX_AUXILARY_IOV_MAX 64
475
#endif
476
#if defined(IOV_MAX) && IOV_MAX < MDBX_AUXILARY_IOV_MAX
477
#undef MDBX_AUXILARY_IOV_MAX
478
#define MDBX_AUXILARY_IOV_MAX IOV_MAX
479
#endif
/* MDBX_AUXILARY_IOV_MAX */
480
481
/* An extra/custom information provided during library build */
482
#ifndef MDBX_BUILD_METADATA
483
#define MDBX_BUILD_METADATA ""
484
#endif
/* MDBX_BUILD_METADATA */
486
/*******************************************************************************
487
*******************************************************************************
488
******************************************************************************/
489
490
#ifndef DOXYGEN
491
492
/* In case the MDBX_DEBUG is undefined set it corresponding to NDEBUG */
493
#ifndef MDBX_DEBUG
494
#ifdef NDEBUG
495
#define MDBX_DEBUG 0
496
#else
497
#define MDBX_DEBUG 1
498
#endif
499
#endif
500
#if MDBX_DEBUG < 0 || MDBX_DEBUG > 2
501
#error "The MDBX_DEBUG must be defined to 0, 1 or 2"
502
#endif
/* MDBX_DEBUG */
503
504
#else
505
506
/* !!! Actually this is a fake definitions for Doxygen !!! */
507
521
#define MDBX_DEBUG 0...2
522
524
#define MDBX_DISABLE_GNU_SOURCE 0 or 1
525
526
#endif
/* DOXYGEN */
options.h
Generated by
1.12.0