This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * C data structure & debug util library | |
| * Matthew Reiner, 2026 | |
| * Available under the MIT license | |
| * Optional dependency <a.h> for shared locks | |
| * Implements the following: | |
| * - `static_assert` and `assert` with optional message parameters, `soft_assert(expr)` and `breakpoint()` and `hexdump(ptr,len)` for debugging | |
| * - `bit_magN` for the "magnitude" (log2) of an integer. `fast_exp2f`, `discrete_exp2f`, `discrete_log2f` for floating point 2^x and log2(x) approximations | |
| * - `ring_buffer_t` for ring buffers and `ring_iterator_t` for iterators on ring-buffer-like data structures | |
| * - `array_buffer_t` for array buffers (aka vector) and `array_iterator_t` for iterators on array-buffer-like data structures |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Concept implementation of atomic 64-bit load/store on architectures with only 32-bit atomics | |
| * Matthew Reiner, 2026, CC-BY | |
| * Using turnstile-like global locks. | |
| * - Wait-free for uncontended loads. | |
| * - Lock-free for contended loads. | |
| * - Lock-based for stores. | |
| * This file uses C11 atomics, but can be trivially written to use | |
| * architecture- or compiler-specific intrinsics if needed. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Relatively fast and low-level crc64 implementation using the Jones polynomial 0x1AD93D23594C935A9 | |
| * Matthew Reiner, 2026 | |
| * Available under the GPL 3.0 license | |
| * SIMD support for x86, arm and RISC-V | |
| * Software fallback | |
| */ | |
| #pragma once | |
| #include <stdint.h> | |
| #include <stddef.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Atomics & threads complement library | |
| * Matthew Reiner, 2026 | |
| * Available under the MIT license | |
| * Targeting: Windows, Linux, FreeBSD, NetBSD, OpenBSD, MacOS | |
| * Implements the following: | |
| * - Wait/Notify functionality for simple types up to 64 bit | |
| * - Arbitrary condition wait | |
| * - Fine-grained memory ordering | |
| * - Thread management |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Relatively fast and low-level ChaCha20 and Poly1305 implementation | |
| * Matthew Reiner, 2026 | |
| * Available under the GPL 3.0 license | |
| * Fuzz-tested on over 2.5 billion unique inputs for each algorithm, to match libsodium's implementation 1:1 | |
| * Tests performed with clang -O3 and included UB-sanitizer and address-sanitizer | |
| */ | |
| #pragma once | |
| #ifndef _DEFAULT_SOURCE | |
| #define _DEFAULT_SOURCE |