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

Safe HaskellNone
LanguageHaskell2010

Stg.Machine.GarbageCollection

Contents

Description

Remove unused heap objects.

Synopsis

Documentation

garbageCollect :: GarbageCollectionAlgorithm -> StgState -> StgState Source #

Apply a garbage collection algorithm to the heap of the current machine state, and return the resulting cleaned state.

Algorithms

data GarbageCollectionAlgorithm Source #

A garbage collection algorithm is a specific way to get rid of unused heap objects.

triStateTracing :: GarbageCollectionAlgorithm Source #

Remove all unused addresses, without moving the others.

twoSpaceCopying :: GarbageCollectionAlgorithm Source #

Move all used addresses by moving them to a safe location, and delete the leftovers.