61#define SRN_SM_NO_ID UINTPTR_MAX
63#define SM_TRACEPOINT(...) SRN_TRACEPOINT_WITH_GROUP(source_manager __VA_OPT__(, ) __VA_ARGS__)
120[[gnu::nonnull(1, 2)]]
128[[gnu::nonnull(1, 2)]]
A bit-partitioned trie with a tail buffer, used as a growable indexed sequence in the runtime.
This is an implementation of Compressed Hash-Array Mapped Prefix-tree, which is a bit-partitioned,...
static size_t srn_sm_buffer_len(srn_sm_buffer_t *buf)
srn_sm_maybe_buffer_t srn_sm_buffer_file(srn_sm_t *sm, const char *filepath, bool reread)
Read and buffer the given filepath into the source manager and return a srn_sm_maybe_buffer_t which e...
void srn_sm_shutdown(srn_sm_t *sm)
Shutdown the source manager freeing all the buffers.
srn_sm_t * srn_sm_init(srn_context_t *ctx)
Initialize the source manager, as an immortal data structure.
srn_sm_buffer_t * srn_sm_get_buffer(srn_sm_t *sm, srn_sm_buffer_id_t id)
Return the buffer pointer of the given id, nullptr if the id does not exists.
static const unsigned char * srn_sm_buffer_data(srn_sm_buffer_t *buf)
srn_sm_maybe_id_t srn_sm_read_buffer_file(srn_sm_t *sm, const char *filepath, bool reread)
Read and buffer the given filepath into the source manager and return the buffer id.
size_t srn_sm_buffer_id_t
unsigned char * data
nullptr when the source file was empty (no mapping exists)
struct srn_sm_buffer_t * next
srn_fiber_mutex_t write_lock
srn_thread_t, srn_mutex_t, and srn_cond_t model the thread-level operations the runtime needs,...