Struct cell_gc::Heap [] [src]

pub struct Heap { /* fields omitted */ }

Methods

impl Heap
[src]

Create a new, empty heap.

Run some code using this Heap.

Example

use cell_gc::{Heap, GCLeaf};

let mut heap = Heap::new();
heap.enter(|hs| {
    // ... hs.alloc(MyHeapStruct { ... }) ...
});

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

A value that has been pinned n times stays in the root set until it has been unpinned n times.

Safety

p must point to a live allocation of type T in this heap.

Unpin a heap-allocated value (see pin).

Safety

p must point to a pinned allocation of type T in this heap.

Call the given function on each pinned root.

Trait Implementations

impl Drop for Heap
[src]

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