[Oberon] SystemV- Heap + Module Space

Tomas Kral thomas.kral at email.cz
Tue Jan 1 16:05:36 CET 2019


> It depends on what heuristics you want to use to find the gap.

Hi,
Thank you. I am testing a new core with these changes in `Modules.Mod'

[1]
PROCEDURE Load*
...
IF res = 0 THEN (*search for a hole in the list allocate and link - BOTTOM -> TOP*)
  INC(size, DescSize); (*mod*) m := root; mod := NIL;
  (*WHILE (mod # NIL) & ~((mod.name[0] = 0X) & (mod.size >= size)) DO mod := mod.next END ;*)
  WHILE m # NIL DO IF (m.name[0] = 0X) & (m.size >= size) THEN mod := m
  END ; m := m.next END ;

The above works as expected, modules are filled in holes bottom up fashion which I believe conserves module store better then then top bottom approach.

Is there a system pointer marking modules' origin?
mod := org; WHILE (mod # root) DO mod := mod.next END ;

[2]
PROCEDURE Free*
...
 IF mod = root THEN (*increase size of available module space*)
  p := mod.size; mod := mod.next;
  WHILE (mod # NIL) & (mod.name[0] = 0X) DO INC(p, mod.size); mod :=
  mod.next END ; AllocPtr := AllocPtr - p; root := mod
 END
ELSE res := 1
...
The above has sometimes problems, cannot figure out why yet.  I tried commenting  (*mod # NIL) &*). It sometimes locks the system.

-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list