blibs

February 13, 2026 ยท View on GitHub

Build status

Collection of miscellaneous single-header libraries.

LibraryDescription
autolist.hA list of items collected from all compilation units
xincbin.hA cross-platform way to include binary data in your executable
bresmon.hFile watcher
mem_layout.hCombine multiple mallocs of a nested struct into one
barena.hArena allocator
tlsf.hAdaptation of jserv/tlsf-bsd
bhash.hHashtable
barray.hDynamic array
bcoro.hCoroutine
bserial.hBinary serialization
bspsc.hSingle producer single consumer queue
barg.hCLI argument parsing
bmacro.hCommonly used macros
bminmax.hMin/Max/Clamp macros using _Generic
btest.hUnit test framework (based on autolist)
blog.hLogging, with short filenames
qoi.hQuite OK image encoding/decoding
bent.hEntity component system
bsv.hBinary seriallization with explicit versioning
bstacktrace.hPortable stacktrace with source mapping
bcrash_handler.hCrash handler

Each one has example and documentation in the corresponding tests directory.

Tested on:

  • Linux (GCC+Clang)
  • Windows (MSVC)

On allocator

Whenever a library needs to allocate memory a memctx argument can be passed to it. By default it uses libc for memory and memctx is ignored.

The macro <NAME>_REALLOC can be used to override the allocator. BLIB_REALLOC is also recognized as a catch-all allocator.