slenkar писал(а):
to allocate a record I do NEW(ptr,sizeof(record)) ?
Код: "OBERON"
VAR recPtr = POINTER TO RECORD ... END;
BEGIN NEW(recPtr);
slenkar писал(а):
How does OFRONT know not to put garbage collection into the spectrum?
does Oberon use the garbage collection of the system? (system.h?)
Ofront collects the garbage not in each moment, and only if you allocate memory, the runtime search for free blocks and try to re-use its.
If you don't use NEW and pointers at all in your Spectrum program, or use only untagged pointers (Ptr = POINTER [1] TO ...) with manual allocating, garbage collection do not invoked.
Perhaps we would be able to implement a simple garbage collection for Z80 and ZX Spectrum 48K too, and maybe even a dynamic modularity with loading/unloading packed modules from tape, TR DOS disk or 128K memory pages, but we need to think seriously about develop the Oberon-runtime kernel for Z80.