38 return srn_errors_make_error(
srn_context_t * srn_context_make(srn_engine_t *engine)
Make an empty context, by allocating a new memory block.
srn_value_t * srn_value_make(srn_context_t *ctx, srn_value_tag_t tag, srn_metadata_t *metadata, void *payload)
Creates a new serene value.
srn_object_id_t srn_allocate_object_id(srn_engine_t *engine)
Error handling for the runtime.
@ STRING_LENGTH_LIMIT_EXCEEDED
hmap_t hmap_empty(const srn_context_t *ctx)
Create, initialize and return a new hashmap pinned to ctx.
This is an implementation of Compressed Hash-Array Mapped Prefix-tree, which is a bit-partitioned,...
srn_namespace_t * srn_namespace_load(srn_namespace_t *ns)
Load the namespace's source from the filesystem into src_buffer, parse it, and populate the symbol ta...
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.
size_t srn_string_length(const srn_string_t *s)
bool srn_string_is_empty(const srn_string_t *s)
srn_string_t * srn_string_copy(srn_context_t *ctx, const srn_string_t *src)
Allocate a copy of src through ctx and return it.
srn_limits_config_t limits
srn_engine_t * engine
Long term state of the compiler.
srn_configuration_t config
The runtime's tunable knobs, the single source for every configurable value (see configuration....
size_t ns_name_max_len
Longest namespace name accepted, in bytes.
srn_context_t * root_context
srn_spinlock_t src_buffer_lock
Guards every access to source buffer.
srn_namespace_src_buffer_t * src_buffer
The buffer holding the source code for this namespace.
hmap_t sym_table
A mapping symbol names to (srn_value_t with type symbol).
srn_spinlock_t sym_table_lock
#define PANIC_IF_NULL(ptr)
static void srn_spinlock_init(srn_spinlock_t *lock)