Space.T

PROCEDURE Create(): T;
PROCEDURE Destroy(space: T);
Create and destroy an address space.
PROCEDURE Duplicate(space: T): T RAISES {VMError.E};
Create a copy of the space
Note: no copy on write now. Everything is copied eagerly.
PROCEDURE Allocate(space: T; VAR addr: VirtAddr.Address; size: VirtAddr.Size; anywhere: BOOLEAN := FALSE): VirtAddr.T RAISES {VMError.E};
PROCEDURE Deallocate(space:T;v: VirtAddr.T := NIL; addr: VirtAddr.Address; size: VirtAddr.Size): VirtAddr.T RAISES {VMError.E};
These two allocates a memory on the specified region. Note that unlike AddressSpace.allocate, Allocate actually allocates a memory on the region.
PROCEDURE Read(space: T; fromaddr: VirtAddr.Address; VAR to: ARRAY OF CHAR; size := -1) RAISES {VMError.E};
PROCEDURE Write(space: T; READONLY from: ARRAY OF CHAR; to : VirtAddr.Address; size := -1) RAISES {VMError.E};
These procedures reads or writes the specified region. Page faults may happen. If size is ommitted, it is assumed to be NUMBER(to) or NUMBER(from).
PROCEDURE Protect(space: T; v: VirtAddr.T := NIL; addr: VirtAddr.Address; size: VirtAddr.Size; prot: Protection ) RAISES {VMError.E};
This procedure changes the protection mode.