54#define SRN_CONFIG_DEFAULT_BLOCK_SIZE_MAGNITUDE 17U
59#define SRN_CONFIG_DEFAULT_BLOCK_SIZE ((size_t)1 << SRN_CONFIG_DEFAULT_BLOCK_SIZE_MAGNITUDE)
64#define SRN_CONFIG_DEFAULT_FIBER_STACK_SIZE ((size_t)1024 * 1024 * 8)
72#define SRN_CONFIG_DEFAULT_FIBER_GUARD_PAGES ((size_t)16)
79#define SRN_CONFIG_DEFAULT_WORKERS 0U
84#define SRN_CONFIG_DEFAULT_MAX_WORKERS 256U
90#define SRN_MAX_WORKERS 256U
96#define SRN_CONFIG_DEFAULT_REACTOR_RING_MAGNITUDE 8U
101#define SRN_CONFIG_DEFAULT_REACTOR_REAP_BATCH 64U
106#define SRN_CONFIG_DEFAULT_STRING_MAX_LEN ((size_t)1U << 20U)
111#define SRN_CONFIG_DEFAULT_NS_NAME_MAX_LEN 4096U
116#define SRN_CONFIG_DEFAULT_MAX_VALUE_DEPTH 512U
207# define SRN_CHOOSE_BACKEND SRN_REACTOR_EPOLL
211# define SRN_CHOOSE_BACKEND SRN_REACTOR_KQUEUE
215# define SRN_CHOOSE_BACKEND SRN_REACTOR_IOCP
218#ifndef SRN_CHOOSE_BACKEND
219# error "no reactor backend for this target (need epoll/kqueue/IOCP/...)"
236#define SRN_CONFIG_DEFAULTS \
237 ((srn_configuration_t){ \
238 .mm = {.block_size_magnitude = SRN_CONFIG_DEFAULT_BLOCK_SIZE_MAGNITUDE}, \
240 {.stack_size = SRN_CONFIG_DEFAULT_FIBER_STACK_SIZE, \
241 .guard_pages = SRN_CONFIG_DEFAULT_FIBER_GUARD_PAGES, \
242 .workers = SRN_CONFIG_DEFAULT_WORKERS, \
243 .max_workers = SRN_CONFIG_DEFAULT_MAX_WORKERS}, \
246 .ring_magnitude = SRN_CONFIG_DEFAULT_REACTOR_RING_MAGNITUDE, \
247 .reap_batch = SRN_CONFIG_DEFAULT_REACTOR_REAP_BATCH, \
248 .backend = SRN_CHOOSE_BACKEND, \
251 .string_max_len = SRN_CONFIG_DEFAULT_STRING_MAX_LEN, \
252 .ns_name_max_len = SRN_CONFIG_DEFAULT_NS_NAME_MAX_LEN, \
253 .max_value_depth = SRN_CONFIG_DEFAULT_MAX_VALUE_DEPTH \
void srn_config_validate(const srn_configuration_t *config)
A configuration with every field set to its default.
Every runtime knob, in one place.
srn_reactor_config_t reactor
srn_limits_config_t limits
size_t workers
Worker count used when a run does not specify one.
size_t guard_pages
Pages in the guard band below every fiber stack.
size_t max_workers
Hard ceiling a requested worker count is clamped to.
size_t stack_size
Size of every fiber stack, in bytes.
Size and length limits the runtime enforces.
size_t max_value_depth
Deepest value nesting print, eq, and hash accept.
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.
size_t reap_batch
Most completions a worker drains from its channel in a single pass.
size_t ring_magnitude
Magnitude of each channel's SQ/CQ rings, capacity is 1 << magnitude.
srn_reactor_backend_e backend
What IO backend to use.