Skip to main content

Crate bsql_arena

Crate bsql_arena 

Source
Expand description

Bump allocator for row data — one allocation per query result.

All row data (strings, byte arrays) from a single query is allocated into a contiguous arena. When the result is dropped, one deallocation frees everything.

§Thread-local recycling

Arenas are recycled from a thread-local pool (LIFO, up to 4 per thread). The arena object itself is never heap-allocated fresh on the hot path.

§Chunk growth

Initial chunk: 8KB. Growth: double the previous chunk size (capped at 1MB). On reset(), chunks larger than 64KB are discarded to prevent long-term bloat.

Structs§

Arena
A bump allocator for row data.
ArenaRows
A collection of decoded rows backed by an arena.
ValidatedRows
A collection of decoded rows with batch-validated text data.

Functions§

acquire_arena
Acquire an arena from the thread-local pool, or create a new one.
release_arena
Return an arena to the thread-local pool for reuse.