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)128 * 1024)
69#define SRN_CONFIG_DEFAULT_WORKERS 1U
74#define SRN_CONFIG_DEFAULT_MAX_WORKERS 256U
80#define SRN_MAX_WORKERS 256U
86#define SRN_CONFIG_DEFAULT_REACTOR_RING_MAGNITUDE 8U
91#define SRN_CONFIG_DEFAULT_REACTOR_REAP_BATCH 64U
96#define SRN_CONFIG_DEFAULT_STRING_MAX_LEN ((size_t)1U << 20U)
101#define SRN_CONFIG_DEFAULT_NS_NAME_MAX_LEN 4096U
106#define SRN_CONFIG_DEFAULT_MAX_VALUE_DEPTH 512U
192# define SRN_CHOOSE_BACKEND SRN_REACTOR_EPOLL
196# define SRN_CHOOSE_BACKEND SRN_REACTOR_KQUEUE
200# define SRN_CHOOSE_BACKEND SRN_REACTOR_IOCP
203#ifndef SRN_CHOOSE_BACKEND
204# error "no reactor backend for this target (need epoll/kqueue/IOCP/...)"
221#define SRN_CONFIG_DEFAULTS \
222 ((srn_configuration_t){ \
223 .mm = {.block_size_magnitude = SRN_CONFIG_DEFAULT_BLOCK_SIZE_MAGNITUDE}, \
225 {.stack_size = SRN_CONFIG_DEFAULT_FIBER_STACK_SIZE, \
226 .workers = SRN_CONFIG_DEFAULT_WORKERS, \
227 .max_workers = SRN_CONFIG_DEFAULT_MAX_WORKERS}, \
230 .ring_magnitude = SRN_CONFIG_DEFAULT_REACTOR_RING_MAGNITUDE, \
231 .reap_batch = SRN_CONFIG_DEFAULT_REACTOR_REAP_BATCH, \
232 .backend = SRN_CHOOSE_BACKEND, \
235 .string_max_len = SRN_CONFIG_DEFAULT_STRING_MAX_LEN, \
236 .ns_name_max_len = SRN_CONFIG_DEFAULT_NS_NAME_MAX_LEN, \
237 .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 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.