[Oberon] Fw: FPGA - Bitmaps.Mod

Andreas Pirklbauer andreas_pirklbauer at yahoo.com
Fri Apr 7 18:12:38 CEST 2017


Correction: This should read 'TypeDesc' of course, and not 'TypeTag' (which is the *address* of the TypeDesc).

From: Andreas Pirklbauer <andreas_pirklbauer at yahoo.com>
To: ETH Oberon and Related Systems <oberon at lists.inf.ethz.ch> 

...

You don't really need b) and c), so you could write something like:


  TYPE TypeTag = RECORD size: LONGINT;

     ext: ARRAY 3 OF LONGINT;

     ptr: LONGINT;

     <other fields that you may want to add>

  END ;


Then create the "type tag" by writing:


  VAR tag: TypeTag;


and initialise it with:


  tag.size := <size of your object to be allocated>;
  tag.ext[0] := 0; tag.ext[1] := 0; tag.ext[2] := 0;
  tag.ptr := -1;


4. If you want your objects to be automatically collected by the Oberon garbage collector, you must make it globally reachable via a global pointer. Then they will appear in mod.ptr in the module block which are used as roots for the garbage collector. (Oberon uses all named pointer variables in existence as roots for the mark phase of the garbage collector. See Oberon.GC for the details. It simply calls Kernel.Mark(mod.ptr) for each loaded module mod.


Andreas

 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170407/6be7f24b/attachment-0001.html>


More information about the Oberon mailing list