module vrt.gc.manager.pagetable

Companion module to GigaMan, implements the pagetable.

Code Map

//! Companion module to GigaMan, implements the pagetable.
module vrt.gc.manager.pagetable;


//! This struct implements a 1GB page table. It assumes that it has been
//! placed at the beginning of the memory area that it is managing.
struct PageTable
{
public:
	enum MaximumSize;
	enum TotalSize;
	enum FirstSize;
	enum PageSize;
	enum PageEntrySize;
	enum PageEntryBits;
	enum PageTableNum;
	enum PageTableSize;
	enum FirstEntrySize;
	enum FirstEntryBits;
	enum FirstNumBits;
	enum FirstNum;


public:
	alias PageEntryType = u32;
	alias FirstEntryType = u64;


public:
	fn setup(totalArenaSize: size_t) { }
	fn inBounds(ptr: void*) bool { }
	fn canAlloc(n: size_t) bool { }
	fn free(index: size_t, n: size_t) { }
	fn allocIndex(n: size_t) size_t { }
	fn getPageEntryPtrFromIndex(index: size_t) PageEntryType* { }
	fn getPageEntryPtr(ptr: void*) PageEntryType* { }
	fn checkFirst(index: size_t) bool { }
	fn setFirst(index: size_t) { }
	fn setPageEntry(index: size_t, data: PageEntryType) { }
	fn setPageEntry(ptr: void*, data: PageEntryType) { }
	fn globalToRelative(ptr: void*) size_t { }
	fn relativeToGlobal(rel: size_t) void* { }


public:
	static fn relativeToPageIndex(addr: size_t) size_t { }
	static fn relativeToFirstIndex(addr: size_t) size_t { }
	static fn pageIndexToRelative(index: size_t) size_t { }
	static fn pageIndexToFirstIndex(index: size_t) size_t { }
	static fn firstIndexToRelative(index: size_t) size_t { }
	static fn pageTableToBuddyIndex(order: size_t, index: size_t) size_t { }
	static fn buddyIndexToPageTable(order: size_t, index: size_t) size_t { }
	static fn sizeToBuddyOrder(n: size_t) size_t { }
}
struct PageTable

This struct implements a 1GB page table. It assumes that it has been placed at the beginning of the memory area that it is managing.