95 {
101
105
109
110
111
112
113
114
115
116
117
118
119
120
126
127
131
132
133
135
138}
#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.
#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_namespace_t * srn_namespace_get_or_create(srn_engine_t *engine, srn_string_t *name, srn_error_t **err)
Create a new and empty namespace if it is not already created in the engine, if it exists,...
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.
A runtime error, a tag classifying the failure and a human-readable message.
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.