[self-interest] Re: Memory allocation

Gordon Cichon gordon at cichon.de
Thu Jul 8 07:41:39 UTC 1999

Dru Nelson wrote:

> > The resource areas are a special mechanism to handle the allocation of
> > temporary
> > space in a FIFO fashion. They are compareable to the obstacks used by the
> > Gnu CC.
> I've never heard of this. What are obstacks ?  Is this an internal
> lisp structure?

No, this is nothing special to lisp.
It is a method of handling memory allocation and deallocation. Inside
the Self VM memory is managed in three different ways:
1) Non-Garbage-Collected Heaps. These are the CHeapObjects.
These objects have to be deallocated explicitly. This is the method,
memory is alloceted in C using malloc/free, and in C++ with new/delete.
2) Gargabe Collected Heaps. These objects do not have to be explicitly
deallocated, and in Self these objects are stored in a special way with
these tagged pointers.
3) Stacks. Objects are allocated in a FIFO fashion. This is the way,
records are allocated the processor's run-time-stack, and this is the way
the ResourceArea works. It provides some kind of a stack for allocating
It is used mainly for the Self compiler which is written in C++ and does not
use the GCed heap. Stacks are quite handy for memory management while
traversing syntax trees that require large amounts of dynamically allocated
memory and lots of pointers but nevertheless have a quite predictive liveness
behavior. Obstacks are only another implementation for this. They are also
part of the Gnu libc where they are well documented.



eGroups.com home: http://www.egroups.com/group/self-interest
http://www.egroups.com - Simplifying group communications

More information about the Self-interest mailing list