stgi-1.1: Educational implementation of the STG (Spineless Tagless G-machine)

Safe HaskellNone
LanguageHaskell2010

Stg.Machine.Heap

Contents

Description

The STG heap maps memory addresses to closures.

Synopsis

Info

size :: Heap -> Int Source #

Current number of elements in a heap.

Management

lookup :: MemAddr -> Heap -> Maybe HeapObject Source #

Look up a value on the heap.

update :: Mapping MemAddr HeapObject -> Heap -> Heap Source #

Update a value on the heap.

updateMany :: [Mapping MemAddr HeapObject] -> Heap -> Heap Source #

Update many values on the heap.

alloc :: HeapObject -> Heap -> (MemAddr, Heap) Source #

Store a value in the heap at an unused address.

allocMany :: [HeapObject] -> Heap -> ([MemAddr], Heap) Source #

Store many values in the heap at unused addresses, and return them in input order.