Affix
view release on metacpan or search on metacpan
infix/src/common/infix_config.h view on Meta::CPAN
* which ABI implementation will be compiled and used by the JIT engine.
*
* It supports two modes:
* 1. **Forced ABI:** A user can define `INFIX_FORCE_ABI_*` (e.g., via a compiler
* flag like `-DINFIX_FORCE_ABI_SYSV_X64`) to override automatic detection.
* This is essential for cross-compilation, where the host compiler's macros
* would not reflect the target environment.
*
* 2. **Automatic Detection:** If no ABI is forced, it uses the `INFIX_ARCH_*` and
* `INFIX_OS_*` macros to deduce the correct ABI for the current build target.
*/
#if defined(INFIX_FORCE_ABI_WINDOWS_X64)
#define INFIX_ABI_WINDOWS_X64 1
#define INFIX_ABI_FORCED 1
#elif defined(INFIX_FORCE_ABI_SYSV_X64)
#define INFIX_ABI_SYSV_X64 1
#define INFIX_ABI_FORCED 1
#elif defined(INFIX_FORCE_ABI_AAPCS64)
#define INFIX_ABI_AAPCS64 1
#define INFIX_ABI_FORCED 1
#elif defined(INFIX_FORCE_ABI_RISCV64)
#define INFIX_ABI_RISCV64 1
#define INFIX_ABI_FORCED 1
#endif
// Automatic ABI detection if not forced by the user.
#ifndef INFIX_ABI_FORCED
#if defined(INFIX_ARCH_AARCH64)
// All AArch64 platforms (Linux, macOS, Windows) use the same base calling
// convention (AAPCS64), although with minor differences for variadic arguments
// that are handled within the `abi_arm64.c` implementation.
#define INFIX_ABI_AAPCS64
#elif defined(INFIX_ARCH_RISCV)
// RISC-V 64-bit platforms use the RISC-V ELF psABI (lp64d for hard-float Linux).
#define INFIX_ABI_RISCV64
#elif defined(INFIX_ARCH_X64)
#if defined(INFIX_OS_WINDOWS)
// Windows on x86-64 uses the Microsoft x64 calling convention.
#define INFIX_ABI_WINDOWS_X64
#else
// All other x86-64 platforms (Linux, macOS, BSDs, etc.) use the System V AMD64 ABI.
#define INFIX_ABI_SYSV_X64
#endif
#endif
#endif // INFIX_ABI_FORCED
// Miscellaneous Constants
/**
* @def INFIX_TRAMPOLINE_HEADROOM
* @brief Extra bytes to allocate in a trampoline's private arena.
*
* @details When a trampoline handle is created, it deep-copies all type information
* from a source (like the parser's temporary arena) into its own private arena.
* The size of the source arena is used as a hint for the new arena's size, but the
* copy process itself requires a small amount of extra memory for its own bookkeeping
* (e.g., the memoization list in `_copy_type_graph_to_arena_recursive`). This
* headroom provides that extra space to prevent allocation failures during the copy.
*/
#define INFIX_TRAMPOLINE_HEADROOM 128
/**
* @def INFIX_SANITY_CHECK_ENABLE
* @brief If defined and non-zero, the JIT will emit extra instructions to verify
* stack consistency around user-provided marshaller calls.
*/
#ifndef INFIX_SANITY_CHECK_ENABLE
#define INFIX_SANITY_CHECK_ENABLE 0
#endif
/**
* @def INFIX_INTERNAL
* @brief When compiling with -fvisibility=hidden, we use this to explicitly mark internal-but-shared functions as
* hidden.
*/
#if (defined(__GNUC__) || defined(__clang__)) && !defined(_WIN32) && !defined(__CYGWIN__)
#define INFIX_INTERNAL __attribute__((visibility("hidden")))
#else
#define INFIX_INTERNAL
#endif
/** @endinternal */
( run in 1.858 second using v1.01-cache-2.11-cpan-9789f410c06 )