pub fn new_bvec<T>(cap: usize) -> Vec<'static, T>
Expand description
Creates a new BVec
with a specified capacity.
This function utilizes thread-local storage to access a bump allocator, referred to as THR_ARENA
, and constructs a BVec
with a given capacity (cap
).
It obtains a reference to this arena, which is a bump allocator instance, and uses it to allocate and manage the memory for the BVec
.
This approach leverages unsafe code to perform pointer dereferencing and ensures that the memory management is efficient for temporary allocations within concurrent environments.