Oberon || Library || Module Index || Search Engine || Definition || Module
Additionally, this version also implements the UntaggedStorage interface.
The current implementation utilizes SysMemory.Map which allows to allocate memory at arbitrary memory locations and Memory which manages the address space. During startup, SysStorage initializes Memory and calls Memory.SetPageSize. Further, SysStorage examines the segments of SysSegments and registers them by calling Memory.ReserveRegion.
SysStorage supports growing stacks and redzone protections. For this to work, it defines a handler for SysSignals.SIGSEGV which checks all memory access faults for being stack extensions. The event component fixed will be set to TRUE if the address which caused the failure will be valid afterwards.
A copying garbage collector is available. During a garbage collection, all global data and coroutine stacks are scanned for pointers refering to dynamic storage objects. All objects within reach are copied into a new memory location and the corresponding pointer values are corrected.
When very large objects are requested (e.g. object size greater than the system's page size), SysStorage checks if it is advantageous to treat them in a special way which makes it possible that such objects need not be copied by the garbage collector and the amount of memory needed for running a garbage collection is reduced.
For best address space utilization in case of large objects, it is recommended to request sizes which are (nearly) a power of 2.
After a garbage collection, the old memory regions are deallocated using Memory.ReleaseRegion and SysMemory.Unmap. SysStorage also looks for coroutines which can not be activated and is responsible for the deallocation of their stacks. In that case, SysInterrupts.interrupts is updated.
Process.endOfGarbageCollection is guaranteed to be raised, if Process.startOfGarbageCollection has been before, but it may occur that Process.startOfGarbageCollection is raised and and no garbage collection can be performed. This happens when SysInterrupts.interrupts is not 0, or if there is not enough storage left to run a collection. A garbage collection is also rejected, if the current priority is higher than Priorities.storage (Process.startOfGarbageCollection is not raised).
This implementation does not use Coroutines.tag to identify coroutines.
Oberon || Library || Module Index || Search Engine || Definition || Module