pub(crate) struct Block<const CONST: bool> {
pub(in core) objects: Bump,
pub(in core) drop_stack: RefCell<Vec<DropStackElem>>,
pub(in core) lisp_hashtables: RefCell<Vec<*const LispHashTable>>,
pub(in core) uninterned_symbol_map: UninternedSymbolMap,
}
Expand description
A block of allocations. This type should be owned by Context and not used directly.
Fields§
§objects: Bump
§drop_stack: RefCell<Vec<DropStackElem>>
§lisp_hashtables: RefCell<Vec<*const LispHashTable>>
§uninterned_symbol_map: UninternedSymbolMap
Implementations§
Source§impl Block<true>
impl Block<true>
pub(crate) fn new_global() -> Self
Source§impl Block<false>
impl Block<false>
pub(crate) fn new_local() -> Self
pub(crate) fn new_local_unchecked() -> Self
pub(crate) fn assert_unique()
Source§impl<const CONST: bool> Block<CONST>
impl<const CONST: bool> Block<CONST>
pub(crate) fn add<'ob, T, Tx>(&'ob self, obj: T) -> Gc<ObjectType<'ob>>
pub(crate) fn add_as<'ob, T, Tx, V>(&'ob self, obj: T) -> Gc<V>
Sourcepub(crate) fn string_with_capacity(&self, cap: usize) -> String<'_>
pub(crate) fn string_with_capacity(&self, cap: usize) -> String<'_>
Create a new String whose backing storage is already part of the GC heap. Does not require dropping when moved during garbage collection (unlike std::string).
Sourcepub(crate) fn vec_new(&self) -> GcVec<'_, Gc<ObjectType<'_>>>
pub(crate) fn vec_new(&self) -> GcVec<'_, Gc<ObjectType<'_>>>
Create a new Vec whose backing storage is already part of the GC heap. Does not require dropping when moved during garbage collection (unlike std::vec).
pub(crate) fn vec_with_capacity( &self, cap: usize, ) -> GcVec<'_, Gc<ObjectType<'_>>>
Trait Implementations§
impl<const C: bool> Send for Block<C>
Auto Trait Implementations§
impl<const CONST: bool> !Freeze for Block<CONST>
impl<const CONST: bool> !RefUnwindSafe for Block<CONST>
impl<const CONST: bool> !Sync for Block<CONST>
impl<const CONST: bool> Unpin for Block<CONST>
impl<const CONST: bool> !UnwindSafe for Block<CONST>
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