#[doc(hidden)]pub struct ThreadLocalState<M: MapStorage> {
pub inner: ArenaState<M>,
pub initialized: bool,
}Expand description
State wrapper for thread-local arenas (used by macro).
Fields§
§inner: ArenaState<M>§initialized: boolImplementations§
Source§impl<M: MapStorage> ThreadLocalState<M>
impl<M: MapStorage> ThreadLocalState<M>
Sourcepub const fn uninit() -> Self
pub const fn uninit() -> Self
Create an uninitialized thread-local arena state.
Call init or init_with_capacity before use.
Sourcepub unsafe fn init(&mut self)
pub unsafe fn init(&mut self)
Initialize with default capacity (16 slots).
For ppsize-scale workloads, prefer init_with_capacity
to avoid backing VECSXP growth and map rehashing during operation.
§Safety
Must be called from the R main thread. Must only be called once.
Sourcepub unsafe fn init_with_capacity(&mut self, capacity: usize)
pub unsafe fn init_with_capacity(&mut self, capacity: usize)
Initialize with specific capacity.
Pre-sizing avoids growth of the backing VECSXP and rehashing of the internal map. Use this when the expected number of distinct protected values is known or can be estimated (e.g., the length of an input vector).
§Safety
Must be called from the R main thread. Must only be called once.
Trait Implementations§
Source§impl<M: MapStorage> Drop for ThreadLocalState<M>
impl<M: MapStorage> Drop for ThreadLocalState<M>
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.