libmdbx  0.11.6.39 (2022-04-13T11:05:50+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
Build options

The libmdbx build options. More...

Macros

#define MDBX_OSX_WANNA_DURABILITY   0
 
#define MDBX_OSX_WANNA_SPEED   1
 
#define MDBX_OSX_SPEED_INSTEADOF_DURABILITY   MDBX_OSX_WANNA_DURABILITY
 
#define MDBX_ENV_CHECKPID   1
 
#define MDBX_ENV_CHECKPID_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_ENV_CHECKPID)
 
#define MDBX_TXN_CHECKOWNER   1
 
#define MDBX_TXN_CHECKOWNER_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_TXN_CHECKOWNER)
 
#define MDBX_TRUST_RTC   1
 
#define MDBX_TRUST_RTC_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_TRUST_RTC)
 
#define MDBX_ENABLE_REFUND   1
 
#define MDBX_ENABLE_PGOP_STAT   1
 
#define MDBX_ENABLE_MADVISE   1
 
#define MDBX_DISABLE_PAGECHECKS   0
 
#define MDBX_PNL_PREALLOC_FOR_RADIXSORT   1
 
#define MDBX_DPL_PREALLOC_FOR_RADIXSORT   1
 
#define MDBX_FAKE_SPILL_WRITEMAP   0
 
#define MDBX_PNL_ASCENDING   0
 
#define MDBX_WITHOUT_MSVC_CRT   1
 
#define MDBX_ENVCOPY_WRITEBUF   1048576u
 
#define MDBX_FORCE_ASSERTIONS   0
 
#define MDBX_ASSUME_MALLOC_OVERHEAD   (sizeof(void *) * 2u)
 
#define MDBX_DEBUG   1
 
#define MDBX_DEBUG   0...7
 
#define MDBX_LOCKING_WIN32FILES   -1
 
#define MDBX_LOCKING_SYSV   5
 
#define MDBX_LOCKING_POSIX1988   1988
 
#define MDBX_LOCKING_POSIX2001   2001
 
#define MDBX_LOCKING_POSIX2008   2008
 
#define MDBX_LOCKING_BENAPHORE   1995
 
#define MDBX_LOCKING   MDBX_LOCKING_SYSV
 
#define MDBX_LOCKING_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_LOCKING)
 
#define MDBX_USE_OFDLOCKS   0
 
#define MDBX_USE_OFDLOCKS_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_USE_OFDLOCKS)
 
#define MDBX_USE_SENDFILE   0
 
#define MDBX_USE_COPYFILERANGE   0
 
#define MDBX_USE_SYNCFILERANGE   0
 
#define MDBX_CPU_WRITEBACK_INCOHERENT   0
 
#define MDBX_MMAP_INCOHERENT_FILE_WRITE   0
 
#define MDBX_MMAP_INCOHERENT_CPU_CACHE   0
 
#define MDBX_64BIT_ATOMIC   1
 
#define MDBX_64BIT_ATOMIC_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_64BIT_ATOMIC)
 
#define MDBX_64BIT_CAS   1
 
#define MDBX_64BIT_CAS_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_64BIT_CAS)
 
#define MDBX_UNALIGNED_OK   0 /* no unaligned access allowed */
 
#define MDBX_CACHELINE_SIZE   64
 

Detailed Description

The libmdbx build options.

Macro Definition Documentation

◆ MDBX_64BIT_ATOMIC

#define MDBX_64BIT_ATOMIC   1

◆ MDBX_64BIT_ATOMIC_CONFIG

#define MDBX_64BIT_ATOMIC_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_64BIT_ATOMIC)

◆ MDBX_64BIT_CAS

#define MDBX_64BIT_CAS   1

◆ MDBX_64BIT_CAS_CONFIG

#define MDBX_64BIT_CAS_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_64BIT_CAS)

◆ MDBX_ASSUME_MALLOC_OVERHEAD

#define MDBX_ASSUME_MALLOC_OVERHEAD   (sizeof(void *) * 2u)

Presumed malloc size overhead for each allocation to adjust allocations to be more aligned.

◆ MDBX_CACHELINE_SIZE

#define MDBX_CACHELINE_SIZE   64

◆ MDBX_CPU_WRITEBACK_INCOHERENT

#define MDBX_CPU_WRITEBACK_INCOHERENT   0

◆ MDBX_DEBUG [1/2]

#define MDBX_DEBUG   1

In case the MDBX_DEBUG is undefined set it corresponding to NDEBUG

Controls enabling of debugging features.

  • MDBX_DEBUG = 0 (by default) Disables any debugging features at all, including logging and assertion controls. Logging level and corresponding debug flags changing by mdbx_setup_debug() will not have effect.
  • MDBX_DEBUG > 0 Enables code for the debugging features (logging, assertions checking and internal audit). Simultaneously sets the default logging level to the MDBX_DEBUG value. Also enables MDBX_DBG_AUDIT if MDBX_DEBUG >= 2.

◆ MDBX_DEBUG [2/2]

#define MDBX_DEBUG   0...7

In case the MDBX_DEBUG is undefined set it corresponding to NDEBUG

Controls enabling of debugging features.

  • MDBX_DEBUG = 0 (by default) Disables any debugging features at all, including logging and assertion controls. Logging level and corresponding debug flags changing by mdbx_setup_debug() will not have effect.
  • MDBX_DEBUG > 0 Enables code for the debugging features (logging, assertions checking and internal audit). Simultaneously sets the default logging level to the MDBX_DEBUG value. Also enables MDBX_DBG_AUDIT if MDBX_DEBUG >= 2.

◆ MDBX_DISABLE_PAGECHECKS

#define MDBX_DISABLE_PAGECHECKS   0

Disable some checks to reduce an overhead and detection probability of database corruption to a values closer to the LMDB.

◆ MDBX_DPL_PREALLOC_FOR_RADIXSORT

#define MDBX_DPL_PREALLOC_FOR_RADIXSORT   1

◆ MDBX_ENABLE_MADVISE

#define MDBX_ENABLE_MADVISE   1

Controls use of POSIX madvise() hints and friends.

◆ MDBX_ENABLE_PGOP_STAT

#define MDBX_ENABLE_PGOP_STAT   1

Controls gathering statistics for page operations.

◆ MDBX_ENABLE_REFUND

#define MDBX_ENABLE_REFUND   1

Controls online database auto-compactification during write-transactions.

◆ MDBX_ENV_CHECKPID

#define MDBX_ENV_CHECKPID   1

Controls checking PID against reuse DB environment after the fork()

◆ MDBX_ENV_CHECKPID_CONFIG

#define MDBX_ENV_CHECKPID_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_ENV_CHECKPID)

◆ MDBX_ENVCOPY_WRITEBUF

#define MDBX_ENVCOPY_WRITEBUF   1048576u

Size of buffer used during copying a environment/database file.

◆ MDBX_FAKE_SPILL_WRITEMAP

#define MDBX_FAKE_SPILL_WRITEMAP   0

◆ MDBX_FORCE_ASSERTIONS

#define MDBX_FORCE_ASSERTIONS   0

Forces assertion checking

◆ MDBX_LOCKING

#define MDBX_LOCKING   MDBX_LOCKING_SYSV

Advanced: Choices the locking implementation (autodetection by default).

◆ MDBX_LOCKING_BENAPHORE

#define MDBX_LOCKING_BENAPHORE   1995

BeOS Benaphores, aka Futexes for MDBX_LOCKING

◆ MDBX_LOCKING_CONFIG

#define MDBX_LOCKING_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_LOCKING)

◆ MDBX_LOCKING_POSIX1988

#define MDBX_LOCKING_POSIX1988   1988

POSIX-1 Shared anonymous semaphores for MDBX_LOCKING

◆ MDBX_LOCKING_POSIX2001

#define MDBX_LOCKING_POSIX2001   2001

POSIX-2001 Shared Mutexes for MDBX_LOCKING

◆ MDBX_LOCKING_POSIX2008

#define MDBX_LOCKING_POSIX2008   2008

POSIX-2008 Robust Mutexes for MDBX_LOCKING

◆ MDBX_LOCKING_SYSV

#define MDBX_LOCKING_SYSV   5

SystemV IPC semaphores for MDBX_LOCKING

◆ MDBX_LOCKING_WIN32FILES

#define MDBX_LOCKING_WIN32FILES   -1

If defined then enables integration with Valgrind, a memory analyzing tool. If defined then enables use C11 atomics, otherwise detects ones availability automatically. Win32 File Locking API for MDBX_LOCKING

◆ MDBX_MMAP_INCOHERENT_CPU_CACHE

#define MDBX_MMAP_INCOHERENT_CPU_CACHE   0

◆ MDBX_MMAP_INCOHERENT_FILE_WRITE

#define MDBX_MMAP_INCOHERENT_FILE_WRITE   0

◆ MDBX_OSX_SPEED_INSTEADOF_DURABILITY

#define MDBX_OSX_SPEED_INSTEADOF_DURABILITY   MDBX_OSX_WANNA_DURABILITY

◆ MDBX_OSX_WANNA_DURABILITY

#define MDBX_OSX_WANNA_DURABILITY   0

Using fcntl(F_FULLFSYNC) with 5-10 times slowdown

◆ MDBX_OSX_WANNA_SPEED

#define MDBX_OSX_WANNA_SPEED   1

Using fsync() with chance of data lost on power failure

◆ MDBX_PNL_ASCENDING

#define MDBX_PNL_ASCENDING   0

Controls sort order of internal page number lists. This mostly experimental/advanced option with not for regular MDBX users.

Warning
The database format depend on this option and libmdbx builded with different option value are incompatible.

◆ MDBX_PNL_PREALLOC_FOR_RADIXSORT

#define MDBX_PNL_PREALLOC_FOR_RADIXSORT   1

◆ MDBX_TRUST_RTC

#define MDBX_TRUST_RTC   1

Does a system have battery-backed Real-Time Clock or just a fake.

◆ MDBX_TRUST_RTC_CONFIG

#define MDBX_TRUST_RTC_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_TRUST_RTC)

◆ MDBX_TXN_CHECKOWNER

#define MDBX_TXN_CHECKOWNER   1

Controls checking transaction owner thread against misuse transactions from other threads.

◆ MDBX_TXN_CHECKOWNER_CONFIG

#define MDBX_TXN_CHECKOWNER_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_TXN_CHECKOWNER)

◆ MDBX_UNALIGNED_OK

#define MDBX_UNALIGNED_OK   0 /* no unaligned access allowed */

◆ MDBX_USE_COPYFILERANGE

#define MDBX_USE_COPYFILERANGE   0

Advanced: Using copy_file_range() syscall (autodetection by default).

◆ MDBX_USE_OFDLOCKS

#define MDBX_USE_OFDLOCKS   0

Advanced: Using POSIX OFD-locks (autodetection by default).

◆ MDBX_USE_OFDLOCKS_CONFIG

#define MDBX_USE_OFDLOCKS_CONFIG   "AUTO=" MDBX_STRINGIFY(MDBX_USE_OFDLOCKS)

◆ MDBX_USE_SENDFILE

#define MDBX_USE_SENDFILE   0

Advanced: Using sendfile() syscall (autodetection by default).

◆ MDBX_USE_SYNCFILERANGE

#define MDBX_USE_SYNCFILERANGE   0

Advanced: Using sync_file_range() syscall (autodetection by default).

◆ MDBX_WITHOUT_MSVC_CRT

#define MDBX_WITHOUT_MSVC_CRT   1

Avoid dependence from MSVC CRT and use ntdll.dll instead.