next up previous
Next: MemoryAccess Up: simlib Previous: MemInfoClass

MemManagerClass


     NAME
	  memmanagerclass - contains routines to control Simula	memory
	  management (GC)

     DESCRIPTION
	  The routines in this class can be used to control the
	  actions of the garbage collector.

     AUTHOR
	  Boris	Magnusson, Lund	University.

     DETAILED INTERFACE
	     class MemManagerClass;
	  The routines in this	class  can  be	used  to  control  the
	  actions of the garbage collector. One	can measure the	memory
	  usage	and request Garbage Collection from the	user  program.
	  This	might  be  interresting	 in  order  to avoid GC	during
	  sensitive periods of program execution.

	  Supers: -
	  Kind:	Instantiable
	  Init:	none
	  Sequencing: (GetFreeMemory / CallGC /	NeedsMemory)*

     OPERATIONS
     GetFreeMemory
	     integer procedure GetFreeMemory;
	  Return the amount of free memory in bytes, e.g. what can  be
	  allocated before next	garbage	collection.

     CallGC
	     procedure CallGC;
	  Call the garbage collector to	free memory.

     NeedsMemory
	     procedure NeedsMemory(Amount);
	     integer Amount; ! Low water mark.;
	  Check	if Amount bytes	of memory  can	be  allocated  without
	  calling the GC, if not the GC	is called now. If after	the GC
	  there	is  not	 enough	 memory	 available  the	 execution  is
	  interrupted.