|
rlib
Convenience library for useful things
|
Containers, strings, multi-precision integers and the supporting primitives (hash functions, hazard pointers, callback tuples) that the rest of rlib builds on. More...
Modules | |
| Bitset | |
Fixed-width array of bits stored as a flexible-array rbsword tail, with the usual set / get / popcount / clz / ctz surface plus AND / OR / XOR / NOT compound operations. | |
| Callback context tuples | |
(function, data, user, datanotify, usernotify) tuples used by the callback-flavoured lists and queues to store deferred work without losing track of ownership. | |
| Dictionary (string-keyed hashtable) | |
| Thin convenience wrapper around RHashTable that preconfigures string hashing / equality and renames the surface to a more dictionary-flavoured spelling. | |
| Directory tree | |
| Refcounted tree keyed by slash-separated path components, with per-node data and optional destroy / visit functions. | |
| Hash functions | |
Default RHashFunc / REqualFunc implementations used by Hash table and Hash set when the caller doesn't want to spell out a custom pair. | |
| Hash set | |
| Refcounted hash set: the keys-only sibling of Hash table. | |
| Hash table | |
| Refcounted hash map with caller-supplied hash and equality functions and optional per-key / per-value destroy notifiers. | |
| Hazard pointers | |
Safe reclamation for lock-free data structures: readers publish "I'm using @c p" hazard records so writers know not to free p until every reader has moved on. | |
| Key-value pointer array | |
Growable, refcounted ordered array of (key, value) pointer pairs. | |
| Linked lists | |
| Doubly- and singly-linked list templates plus the four callback-flavoured specialisations that the rest of rlib uses to manage deferred work. | |
| Multi-precision integer (mpint) | |
| Heap-allocated big-integer rmpint plus the fixed-width Montgomery-form RMpintFE companions used by rlib's constant-time crypto primitives. | |
| Pointer array | |
Growable, refcounted array of rpointer values with optional per-slot destroy notifiers. | |
| Queues | |
| Three queue implementations for different access patterns: a list-backed FIFO, a callback queue keyed on RFuncCallbackCtx, and a refcounted circular ring buffer with bounded capacity. | |
| Timeout callback list | |
| Ordered list of callbacks keyed on absolute deadlines; the building block under rlib's event-loop timers. | |
| Refcounting | |
| RRef is the refcount base struct that every refcounted type in rlib embeds at offset 0 - hashtables, buffers, crypto handles, RTC sessions, parsers, the rest. | |
Containers, strings, multi-precision integers and the supporting primitives (hash functions, hazard pointers, callback tuples) that the rest of rlib builds on.
The data sub-tree groups into a few areas:
r_mpint, the multi-precision integer and its constant-time Montgomery-form RMpintFE companions.r_string, a refcounted growable byte string.r_hashtable, r_hashset and r_dictionary (a typedef alias for RHashTable). The hash itself is pluggable via r_hashfuncs.r_list (doubly-linked), r_queue (deque / ring buffer), r_ptrarray and the keyed r_kvptrarray.r_bitset, r_dirtree (path-component tree), r_timeoutcblist (timer-driven callbacks).r_hzrptr (hazard pointers for safe reclamation in lock-free data structures).r_cbctx, the (function, ctx, destroy-notify) tuple that r_timeoutcblist and other callback collections key on.Refcounted data structures here derive from RRef (declared in rlib/rref.h); the r_*_ref / r_*_unref macros each delegates to r_ref_ref / r_ref_unref.