pub struct RAllocator;Expand description
R-backed global allocator.
All allocations are backed by R RAWSXP objects and protected from garbage collection. The allocator stores metadata before the returned pointer to enable proper deallocation.
Note: This should NOT be used as #[global_allocator] in R package
library crates, as it would be invoked during compilation/build time when
R isn’t available. Instead, use it explicitly in standalone binaries that
embed R, or use arena-style allocation APIs.
§Thread Safety
This allocator is safe to use from any thread. R API calls are automatically
routed to the main thread via with_r_thread_or_inline.
Trait Implementations§
Source§impl Debug for RAllocator
impl Debug for RAllocator
Source§impl GlobalAlloc for RAllocator
impl GlobalAlloc for RAllocator
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout. Read moreAuto Trait Implementations§
impl Freeze for RAllocator
impl RefUnwindSafe for RAllocator
impl Send for RAllocator
impl Sync for RAllocator
impl Unpin for RAllocator
impl UnsafeUnpin for RAllocator
impl UnwindSafe for RAllocator
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
Mutably borrows from an owned value. Read more