31 X("namespace::make", test_ns_make), X("config::wiring", test_config_wiring), \
32 X("config::runtime_macros", test_runtime_macros)
#define TEST_ASSERT(cond)
#define RELEASE_CONTEXT(x)
#define SHUTDOWN_ENGINE(mm, engine)
#define MAKE_ENGINE(mm, engine)
#define MAKE_CONTEXT(engine, x)
#define SRN_CONFIG_DEFAULTS
srn_metadata_t absurd_metadata
We use this for testing. Defined once in core.c.
@ VError
VError should be last.
#define AS_STRING(value_ref)
#define IS_A(value_ref, field)
srn_mm_t * srn_mm_init(const srn_configuration_t *config)
Initialize the memory manager, this function will panic on error.
srn_engine_t * srn_engine_make(srn_mm_t *mm, const srn_configuration_t *config)
Create the engine over mm, copying config (the runtime's knobs) into it.
srn_fiber_t * srn_fiber_spawn(srn_context_t *ctx, srn_fiber_entry_t entry, void *arg)
Make and schedule a fiber with every default, the engine's scheduler, the configured stack size,...
AI Generated (🤦) Fiber subsystem overview.
static size_t srn_fiber_stack_size(srn_fiber_stack_t s)
void * srn_fiber_result_t
What a fiber's entry produces, type-erased.
srn_value_t * srn_namespace_make(srn_context_t *ctx, srn_metadata_t *metadata, srn_string_t *name)
Creates a new namespace in the give context.
static void test_config_wiring()
static void test_ns_make()
static srn_fiber_result_t config_wiring_fiber_entry(srn_context_t *ctx, void *arg)
static void test_runtime_macros()
#define SERENE_RUNTIME_SHUTDOWN(engine)
Tear down what SERENE_RUNTIME_INIT brought up, in reverse order, the engine (reactor,...
#define SERENE_RUNTIME_INIT_WITH_SCHED(engine, sched, config)
SERENE_RUNTIME_INIT plus a sched variable bound to the engine's scheduler, which every run and fiber ...
void srn_sched_shutdown(srn_scheduler_t *sched)
The one stop tear down of the fiber subsystem, should be called once srn_sched_run has returned.
void srn_sched_run(srn_scheduler_t *sched, size_t nworkers)
Run the scheduler with nworkers os threads draining it, returning once the pool goes quiescent (every...
srn_value_t * srn_string_make(srn_context_t *ctx, srn_metadata_t *metadata, const char *src)
Create a string from a null terminated C string.
bool srn_string_eq(const srn_string_t *a, const srn_string_t *b)
Every runtime knob, in one place.
srn_limits_config_t limits
Engine is a structure to own the long living and main pieces of the compiler.
srn_scheduler_t * scheduler
The fiber scheduler, that is the entry point of the fiber subsystem.
size_t stack_size
Size of every fiber stack, in bytes.
size_t ns_name_max_len
Longest namespace name accepted, in bytes.
size_t string_max_len
Largest string accepted, in bytes.
size_t block_size_magnitude
Magnitude of one block the arena hands out from.
Main memory manager structure that will own all the allocated blocks and data.