module vrt.gc.arena

Code Map

module vrt.gc.arena;


enum MULTIPLICATION_FACTOR_ORIGIN;
enum MULTIPLICATION_FACTOR_MAX;
enum MULTIPLICATION_FACTOR_INCREMENT;

//! An Arena is an instance of the GC.
struct Arena
{
public:
	freeSlabs: Slab*[13];
	freePtrSlabs: Slab*[13];
	freeFinSlabs: Slab*[13];
	freePtrFinSlabs: Slab*[13];
	usedSlabs: Slab*;
	stackBottom: void*;
	hits: HitStack;
	removes: HitStack;


public:
	fn setup() { }
	fn shutdown() { }
	fn getStats(stats: Stats) { }
	fn allocEntry(typeinfo: TypeInfo, count: size_t) void* { }
	fn collect() { }
	fn totalSize() size_t { }


public:
	static fn allocArena() Arena* { }


protected:
	mNextCollection: size_t;
	mMultiplicationFactor: f64;


protected:
	//! Prune the a free slab list, checking usedSlots and following
	//! slab->next.
	fn pruneFreeSlabs(s: Slab*) Slab* { }
	//! Prune the used slab list, checking usedSlots and freeSlots also
	//! following slab->next.
	fn pruneUsedSlabs(s: Slab*) Slab* { }
	fn free(ptr: void*) { }
	fn free(large: Large*) { }
	fn free(ptr: void*, s: Slab*) { }
	fn scanStack() bool { }
	fn scanSlab(s: Slab*, ptr: const(const(void)*)) bool { }
	fn scanLarge(l: Large*) bool { }
	fn scanRange(range: const(const(void)*)[]) bool { }
	fn scan(ptr: void*) bool { }
	fn scanHit(ptr: void*, slab: Slab*) bool { }
	fn scanHit(ptr: void*, large: Large*) bool { }
	fn alloc(n: size_t, hasFinalizer: bool, hasPointer: bool) void* { }
	fn maybeTriggerCollection() { }
	fn allocSmall(n: size_t, hasFinalizer: bool, hasPointer: bool) void* { }
	fn getFreeSlab(order: u8, kind: Extent.Kind) Slab* { }
	fn pushFreeSlab(slab: Slab*) { }
	fn popFreeSlab(slab: Slab*) { }
	fn allocLarge(n: size_t, hasFinalizer: bool, hasPointer: bool) void* { }
	fn allocSlab(order: u8, hasFinalizer: bool, hasPointer: bool) Slab* { }
}

fn __vrt_push_registers(bool delegate()) bool;
struct Arena

An Arena is an instance of the GC.

fn pruneFreeSlabs(s: Slab*) Slab*

Prune the a free slab list, checking usedSlots and following slab->next.

fn pruneUsedSlabs(s: Slab*) Slab*

Prune the used slab list, checking usedSlots and freeSlots also following slab->next.

struct NodeMemCounter

Helper struct for stats counting.