61 {
67
71
75
76
77
82
83
88
89
93
94
95
97
100}
#define TEST_ASSERT(cond)
#define RELEASE_CONTEXT(x)
#define SHUTDOWN_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)
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,...
static size_t srn_fiber_stack_size(srn_fiber_stack_t s)
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 srn_fiber_result_t config_wiring_fiber_entry(srn_context_t *ctx, void *arg)
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.
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.
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.