struct ThreadLocalState {
inner: ArenaState,
initialized: bool,
}Expand description
State wrapper for the thread-local arena.
Fields§
§inner: ArenaState§initialized: boolImplementations§
Source§impl ThreadLocalState
impl ThreadLocalState
Sourceconst fn uninit() -> Self
const fn uninit() -> Self
Create an uninitialized thread-local arena state.
Call init or init_with_capacity before use.
Sourceunsafe fn init(&mut self)
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.
Sourceunsafe fn init_with_capacity(&mut self, capacity: usize)
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 Drop for ThreadLocalState
impl Drop for ThreadLocalState
Auto Trait Implementations§
impl Freeze for ThreadLocalState
impl RefUnwindSafe for ThreadLocalState
impl Send for ThreadLocalState
impl Sync for ThreadLocalState
impl Unpin for ThreadLocalState
impl UnsafeUnpin for ThreadLocalState
impl UnwindSafe for ThreadLocalState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read moreLayout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes