|
infix
A JIT-Powered FFI Library for C
|
Unit test for advanced arena-based memory management features. More...
#include "common/compat_c23.h"#include "common/double_tap.h"#include <infix/infix.h>#include <stdlib.h>Macros | |
| #define | DBLTAP_IMPLEMENTATION |
Functions | |
| void | dummy_func_for_test (void) |
| subtest ("Registry arena is now growable") | |
| subtest ("Shared Arena: Named types are shared via pointers") | |
| subtest ("Default Behavior: Named types are deep-copied") | |
Variables | |
| TEST | |
Unit test for advanced arena-based memory management features.
This test validates two important aspects of the infix memory model. First, it ensures that the internal arena for a default type registry can dynamically grow to handle a large number of definitions, preventing allocation failures.
Second, it verifies the "shared arena" optimization. When a registry and trampolines are created in a user-provided arena, this test confirms that pointers to named types are shared (rather than deep-copied) to save memory. A control test ensures that the standard API without a shared arena maintains its safe, deep-copying behavior.
| #define DBLTAP_IMPLEMENTATION |
| void dummy_func_for_test | ( | void | ) |
| subtest | ( | "Default Behavior: Named types are deep-copied" | ) |
| subtest | ( | "Registry arena is now growable" | ) |
| subtest | ( | "Shared Arena: Named types are shared via pointers" | ) |