Skip to main content

recycle_chunk

Function recycle_chunk 

Source
pub(crate) fn recycle_chunk<C: Columnar>(
    chunk: ColumnBody<C>,
    stash: &mut Vec<ColumnBody<C>>,
)
Expand description

Reset chunk to an empty Typed and push it to stash for reuse.

Chunks recycled here come from the merger and chunker, both of which produce Typed; only the typed allocations are worth caching for reuse. A serialized chunk has no typed-side allocation to preserve, so we simply drop it: empty_chunk will produce a fresh default just as cheaply, and pushing it onto stash would only displace useful recycled allocations.