Struct cell_gc::Heap [] [src]

pub struct Heap<'h> {
    // some fields omitted
}

Methods

impl<'h> Heap<'h>
[src]

unsafe fn pin<T: IntoHeap<'h>>(&self, p: *mut T::In)

Add the object *p to the root set, protecting it from GC.

An object that has been pinned n times stays in the root set until it has been unpinned n times.

(Unsafe because if the argument is garbage, a later GC will crash. Called only from impl GCRef.)

unsafe fn unpin<T: IntoHeap<'h>>(&self, p: *mut T::In)

Unpin an object (see pin).

(Unsafe because unpinning an object that other code is still using causes dangling pointers. Called only from impl GCRef.)

fn try_alloc<T: IntoHeapAllocation<'h>>(&mut self, value: T) -> Option<T::Ref>

unsafe fn from_allocation<T: IntoHeap<'h>>(ptr: *const T::In) -> *const Heap<'h>

unsafe fn get_mark_bit<T: IntoHeap<'h>>(ptr: *const T::In) -> bool

unsafe fn set_mark_bit<T: IntoHeap<'h>>(ptr: *const T::In)

fn alloc<T: IntoHeapAllocation<'h>>(&mut self, value: T) -> T::Ref

fn force_gc(&mut self)

Trait Implementations

impl<'h> Drop for Heap<'h>
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more