|
libhatchet
|
Go to the source code of this file.
Classes | |
| struct | hxsettings |
Functions | |
| void | hxsettings_construct_ (void) |
Variables | |
| struct hxsettings | hxg_settings |
Compiler detection and target specific C++ feature polyfill.
Use #if HX_... instead of #ifdef HX_... for all HX_* macros. HX_USE_NAMESPACE can be used to wrap the library in a namespace.
| #define HX_CPLUSPLUS 202302L |
HX_CPLUSPLUS - A version of __cplusplus that is defined to 0 when __cplusplus is undefined.
Allows use in C preprocessor statements without warnings when the compiler is configured to warn about undefined macros.
| #define HX_CYCLES_PER_SECOND 3.0e+9 |
HX_CYCLES_PER_SECOND - Configures the CPU cycles per second.
This is hardcoded to avoid an OS dependency. WARNING: Processors may change speed.
| #define HX_GIB (1 << 30) |
HX_GIB - A GiB, 2^30.
| #define HX_KIB (1 << 10) |
HX_KIB - A KiB, 2^10.
| #define HX_MAX_LINE (2 * HX_KIB) |
HX_MAX_LINE - Set to 2 KiB.
Line buffer size for formatted messages printed with this platform. Only allocated on the stack.
| #define HX_MEMORY_BUDGET_PERMANENT (4u * HX_KIB) |
HX_MEMORY_BUDGET_PERMANENT - Pool sizes.
Defaults to 4 KiB if not defined. Set to 0 to disable.
| #define HX_MEMORY_MAX_STACKS 3u |
HX_MEMORY_MAX_STACKS - The maximum number of temporary stacks that hxmemory_manager_allocate_stacks may allocate.
Set to 3 for triple buffering if not defined.
| #define HX_MIB (1 << 20) |
HX_MIB - A MiB, 2^20.
| #define HX_PROFILER_MAX_RECORDS 4096 |
HX_PROFILER_MAX_RECORDS - Set to 4096 if not defined.
The profiler doesn't reallocate. This is the maximum.
| #define HX_PROVIDE_NEW_DELETE !(HX_USE_LIBCXX) |
HX_PROVIDE_NEW_DELETE - Provides a new/delete implementation when the std library is absent unless overridden.
Use HX_PROVIDE_NEW_DELETE=-1 when compiling a module to prevent declaration.
| #define HX_QUOTE | ( | x_ | ) |
Converts its arg into a string.
| #define HX_RADIX_SORT_MIN_SIZE 32 |
HX_RADIX_SORT_MIN_SIZE - Radix sort switches to hxinsertion_sort below this size.
Set to 32 if not defined.
| #define HX_USE_CONSOLE ((HX_CPLUSPLUS >= 202002L) ? 1 : 0) |
HX_USE_CONSOLE - Control whether the console is included in the build.
C++20 is required to use the console. 0 - Disables the console. 1 - Enables the console. 2 - Enables the debug console. This allows executing files and modifying memory.
| #define HX_USE_FILE_IO 1 |
HX_USE_FILE_IO - Select if hxfile exists and if it uses C file I/O or POSIX I/O.
stdout is used for logging even when hxfile is disabled. 0
| #define HX_USE_FLOATING_POINT_TRAPS 0 |
| #define HX_USE_GOOGLE_TEST 0 |
HX_USE_GOOGLE_TEST - Switch to using the real Google Test. Defaults to 0.
| #define HX_USE_INLINING_ATTR 1 |
HX_USE_INLINING_ATTR - Controls whether hxinline, hxattr_flatten, and hxattr_hot are enabled.
| #define HX_USE_LIBCXX 1 |
HX_USE_LIBCXX: Indicates whether libstdc++/libc++ are present.
Set -DHX_USE_LIBCXX=0 to signal the C++ standard library is not in use. The C++ standard library is not detected automatically because that depends on header include order.
| #define HX_USE_LOGGING 2 |
HX_USE_LOGGING - Control whether logging statements are included in the build.
Note: hxlog_handler is always available and is used by the asserts. 0 - Disables the logging macros. 1 - All logging except hxlog. 2 - All logging including hxlog. This is the default.
| #define HX_USE_MACROS_WITH_MODULE 0 |
HX_USE_MACROS_WITH_MODULE - Setting -DHX_USE_MACROS_WITH_MODULE=1 when using modules (e.g.
import hx;) will allow the macros in <hx/libhatchet.h>, <hx/hxconsole.hpp>, <hx/hxprofiler.hpp> and <hx/hxtest.hpp> to be textually included alongside import hx;. See src/hxmodule.cppm.
| #define HX_USE_MEMORY_MANAGER 1 |
HX_USE_MEMORY_MANAGER - Used to disable memory management for debugging and for platforms like wasm where extra system allocations are probably cheaper than code size.
| #define HX_USE_PROFILER 0 |
HX_USE_PROFILER - Enable this to use the profiler.
| #define HX_USE_THREADS 11 |
HX_USE_THREADS - 11 indicates C11 threads are in use.
1 is for pthreads and 0 is for no threading.
| #define hxattr_allocator | ( | ... | ) |
hxattr_allocator - Mark allocator/deallocator pairs for static analysis.
See the gcc manual. Must return non-null as well.
| #define hxattr_assume | ( | ... | ) |
hxattr_assume - Tell the optimizer that condition is always true.
Similar to C++23 [[assume(condition)]];.
| #define hxattr_cold |
hxattr_cold - Optimize a function for size.
| #define hxattr_flatten |
hxattr_flatten - Inline every call inside a function's body into it, recursively, regardless of the cost heuristic used for those calls.
| #define hxattr_hot |
hxattr_hot - Optimize a function more aggressively.
Significantly increases code utilization. Adjust implementation according to needs.
| #define hxattr_nodiscard |
hxattr_nodiscard - Indicates the caller should not discard the return value.
| #define hxattr_noexcept |
hxattr_noexcept - Use gcc/clang nothrow attribute.
Unlike noexcept this is undefined when violated.
| #define hxattr_noinline |
hxattr_noinline - Prevents a function from being inlined.
| #define hxattr_nonnull | ( | ... | ) |
hxattr_nonnull - Indicates that a function has args that should not be null.
Checked by UBSan.
| #define hxattr_noreturn |
hxattr_noreturn - Indicates that a function will never return.
E.g., by calling _Exit.
| #define hxattr_printf | ( | ... | ) |
hxattr_printf - Indicates to gcc that a function uses printf-style formatting so it can type-check the format string.
| #define hxattr_scanf | ( | ... | ) |
hxattr_scanf - Indicates to gcc that a function uses scanf-style formatting so it can type-check the format string.
| #define hxattr_weak |
hxattr_weak - Allow calling code to override static library code.
Note: MSVC treats all static library symbols as weak.
| #define hxbreakpoint | ( | ) |
hxbreakpoint - Can be conditionally evaluated with the && and || operators.
Uses intrinsics when available. (E.g., Clang's.) Raises SIGTRAP when __builtin_debugtrap is not available.
| #define hxconstexpr constexpr |
hxconstexpr - Enables C++23 compatable constexpr usage for functions as that has support for destructors.
Falls back to not using constexpr below C++23.
| #define hxif_constexpr if constexpr |
hxif_constexpr - if constexpr on C++17 and later, plain if otherwise.
| #define hxinline inline |
hxinline - Force a function to be inlined into its callers.
Also includes the inline keyword.
| #define hxinline_constexpr inline constexpr |
hxinline_constexpr - Enables C++17 compatable "inline constexpr" usage for variables so they can be exported from modules.
Falls back to not using inline below C++17.
| #define hxrestrict |
hxrestrict - A pointer attribute indicating that for the lifetime of that pointer, it will be the sole means of accessing the object(s) it points to.
Prevents a write iterator from interfering with a read iterator.
| void hxsettings_construct_ | ( | void | ) |
hxsettings_construct - Internal. Used to reset settings at startup.
|
extern |
hxg_settings - Global class constructed by hxinit.