Files
LibretroAdmin d02f74f74a libretro-common: add mempool_t, a fixed-size block allocator
Serves one block size out of chunks taken from malloc() in bulk, with
released blocks going on an intrusive free list. A caller that builds
and tears down N same-sized objects pays a logarithmic number of calls
into libc instead of N, and a rebuild of the same size touches libc not
at all.

Blocks keep their address while held, so a container that relocates the
pointer -- qsort() in file_list_sort_on_alt(), memmove() in
file_list_insert() -- moves the pointer and never the block.

Covered by test/memory/test_mempool.c: block distinctness under a
whole-block write, alignment for an unaligned block size, free-list
reuse, a rebuild taking no new chunk, deinit with blocks outstanding,
and interleaved churn across chunk boundaries. ASan+UBSan+LSan and TSan
both clean, 10/10.
2026-08-29 23:38:45 +02:00
..