Preprocessor defines
The eXtremeDB/rt sources should be compiled with a set of C preprocessor defines that describe the hardware and operating system configuration.
These defines fall into several groups (explained below):
[x64] OS Hardware Debugging [Minicore]x64
- (should be defined for 64 bit platforms)
MCO_PLATFORM_X64OS
_LINUX_MACOS_WIN32_ZEPHYR_FREERTOS_LYNX_INTEGRITY_THREADX_UCOS_VXWORKS_QNX_ECOS_NETOSHardware
_Ix86_ARM32(applicable to 64 bits, too)_MIPS_PPC_XTENZADebugging
Build Modes
The eXtremeDB/rt runtime is typically built in two modes:
Debug Mode – should enable the compiler’s debugging facilities and at least MCO_CFG_CHECKLEVEL_1 (preferably both levels 1 and 2). This configuration helps developers detect and resolve issues during development.
DEBUG MCO_CFG_CHECKLEVEL_1 MCO_CFG_CHECKLEVEL_2Release Mode – provides the best performance and minimizes code, data, and stack footprint. This mode should be used only when the developer is confident that the application is stable and ready for production.
NDEBUG MCO_CFG_CHECKLEVELApplication and Database kernel integrity checks
The eXtremeDB/rt runtime includes additional verification procedures to ensure the integrity of both code and data. These checks are enabled by defining
MCO_CFG_CHECKLEVEL_xon the compiler command line (either directly or as part of the project settings).
- If no
MCO_CFG_CHECKLEVEL_xare defined, all additional verifications are disabled; only basic runtime validation of API input parameters is performed. This configuration corresponds to the Release build ModeMCO_CFG_CHECKLEVEL_1enables quick checks of the database API input parameters. This helps catch invalid data passed by the application (using the fatal error handler instead of error codes that might be overlooked), invalid internal data structures, and potential invalid pointers or stack overflows.MCO_CFG_CHECKLEVEL_2enables kernel-level consistency checks of internal structures such as page chains, heaps, and memory allocators. These checks greatly improve robustness but may increase execution time and reduce overall database performance.Minicore
When eXtremeDB/rt is compiled with
MCO_CFG_MINIMALdefine, some core features are limited (for example, the maximal number of database instances) or excluded (for example, statistics collection) from the build in order to minimize the code footprint. Please refer toif(n)def MCO_CFG_MINIMALin target/mcolib/mcocfg.h, target/mcolib/mcodisk.h, include/mco.h for the details.Examples
FreeRTOS on a 32 bits ARM processor without debugging and with minicore:
_FREERTOS _ARM32 MCO_CFG_MINIMAL NDEBUGLinux on a x86 processor, 64 bits, debugging enabled:
_LINUX MCO_PLATFORM_X64 _Ix86 DEBUG MCO_CFG_CHECKLEVEL MCO_CFG_CHECKLEVEL_1 MCO_CFG_CHECKLEVEL_2 MCO_CFG_CHECKLEVEL_3 MCO_CFG_CHECKLEVEL_1 MCO_CFG_CHECKLEVEL_2 MCO_CFG_CHECKLEVEL_3 MCO_CFG_CHECKLEVEL_PIN MCO_DEBUG_DISK_CACHE