-*- Text -*-
This is the file .../MOOSE/info/Glossary.nfo, which contains info
about more or less obscure words you may read throughout this documentation.


File: Glossary.nfo	Node: Top	Up:(MOOSE.nfo)

* Menu:

* DOS::				see (* Disk Operating System::)
* Garbage Collection::
* GC:				see (* Garbage Collection::)

TO ADD:
* Disk Operating System::	means a Disk-oriented Operating System
* Escaping:			has different meanings according to the context
*  Escape Sequences::		A simple standard way of multiplexing a line
*  Escaping References::	Object references that escape their scope
* MS-DOS::			Micro-Soft's DOS for the IBM-PC and compatibles
* Operating System::		A program that manages computer resources

Node: Garbage Collection

  Garbage Collection (or GC) is a mechanism which objects in an infinite
abstract space are made available for actual computation only if they are
needed by the (finite) program running. Object representation are allocated
on a heap when needed, and the space used is eventually freed when the object
is not needed anymore, so that unnecessary objects won't fill the (finite,
costly) memory resource. Note that computation for garbage collection can
*sometimes* be done at compile-time, for objects that do not escape
(see * Object Escaping::) and or not shared with calling threads.

  If no garbage collection is done, memory may be eventually filled with
unuseful objects as the program runs, and unable to allocate space for new
useful ones. Whereas there would have been enough space should those unuseful
objects' space have been freed. Garbage collection is thus essential for a
system that is meant to run without interruption (as opposed to a system which
reboots each time a program ends with a little problem, like * MS-DOS::).

  The simplest garbage collection scheme is to have a counter for each object.
Each time a new reference to the object is created, the counter is incremented,
while each time an existing reference is destroyed, the counter is decremented.
When the counter is zero, the object space is freed.
  This method is simple, but involves a large overhead each time a reference
is created or destroyed (note that a "same" reference may be copied many
times, as long as those copies do not escape, i.e. be destroyed possibly
*after* the original; any escaping copy must be considered a new reference).
The overhead can be largely reduced by compile-time counter managing. Thus, it
is only efficient when new references seldom appear or disappear, but then it
can be very efficient.
  This method has a quite nastier drawback: memory used grows and decreases
chaotically, and memory will eventually become like swiss cheese, where there
are holes of free space between used objects. The problem is that while total
free space may be big enough to allocate a new needed object, no contiguous
free space is large enough for the object. This may be prevented if objects
are no larger than some given page size, and no page boundary is ever crossed.
But objects larger than this boundary won't be allocated, or will be on
another heap that'll still potentially have the swiss-cheese problem.

  The only way to eliminate this hole problem is to have relocatable objects:
objects may be translated so that holes are filled. But then, all references
to the objects must be corrected so as to reflect the new location.
The process of correcting all addresses may be long enough to prevent
real-time response, so this method cannot be used in a real-time environment
(actually, real-time processes can coexist with this garbage collecting scheme
if 

Node: Escaping References

  An reference (see * Reference::) to an object is said to *escape* a scope
when it is copied into a region that may be freed after this scope. Thus,
the object shall not be freed when the scope exits, even if the other objects
in the scope are made invalid. The object may then be allocated elsewhere than
the execution stack.
  An object (see * Object::) is said to escape a scope when a reference to
this object escapes the scope.
  This notion is useful for * Garbage Collection::.
