[self-interest] Re: Memory allocation

Douglas Atique datique at alcatel.com.br
Thu Jul 8 11:40:35 UTC 1999


gordon at cichon.de wrote:

> 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,
> activation
> 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
> memory.
> 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.

So, Gordon, is it only a matter of convenience? I mean, could all memory
allocated from ResourceAreas be allocated from CHeaps, for example?
For Self objects, on the other hand, I couldn't think of a better allocation
scheme than the garbage-collected allocation, as there is no explicit mechanism
in Self to destroy an object.
Douglas

>
>
> Gordon.
>
> ------------------------------------------------------------------------
> FreeShop is the #1 place for free and trial offers and great deals!
> Try something new and discover more ways to save!
> http://clickhere.egroups.com/click/381
>
> eGroups.com home: http://www.egroups.com/group/self-interest
> http://www.egroups.com - Simplifying group communications


------------------------------------------------------------------------

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