GC or mistake?

Brian T. Rice water at tunes.org
Tue Aug 31 13:50:03 PDT 2004


To be a little more clear, collections which contain themselves are not 
accounted for when you're using a collection which relies on hashing, like 
Set or Dictionary, because the hash method just assumes there's a tree of 
objects without loops.

So it's a "missing feature"; some argue not worthwhile or logical, but on the 
other hand we have memory-management semantics that allow for loops, so who 
knows.

This also is a problem in Smalltalk-80 unless you special-case for it, and 
almost breaks the Golden Rule of mutable collections not to modify them while 
iterating.

Our first goal is to make Slate concurrent, so that things like this happen 
in an isolated process that can be killed before crashing the system, which 
is as good a "fix" right now as any.

Lee Salzman <lsalzman1 at cox.net> said:

> The "hash" method does not work on recursive collections. It will just
> keep recursing forever and ever to build the hash. Not sure whether this
> should be considered a bug or not. ;)
> 
> Lee
> 
> On Tue, Aug 31, 2004 at 07:27:00PM -0000, baseball at nic-nac-project.de wrote:
> > Hi,
> > I was trying out Slate on my home desktop FreeBSD system. Evaluating the
> > following expressions has consistently caused it to attempt to expand the 
heap
> > "beyond limits". Am I doing something illegal, is it a garbage collection 
thing,
> > or what?
> > Well, here's a transcript of my slate session:
> > Slate: Growing heap to 4726380 bytes.
> > Hi, there!
> > Slate 1> addSlot: #a.
> > (Mixins . Types . prototypes . VM .
> >         globals . a . traits )
> > Slate 2> a: (Set newEmpty).
> > {"Set"}
> > Slate 3> a add: a.
> > {"Set" {"Set" {"Set" ...}}}
> > Slate 4> a remove: a.
> > Slate: Growing heap to 8920684 bytes.
> > Slate: Growing heap to 13115004 bytes.
> > Slate: Attempted to grow heap beyond limits
> > 
> > I'm trying to figure slate out...I have experimented with smalltalk and 
am very
> > interested in the ideas behind slate.
> > Thank you,
> > Jim Hartzell




More information about the Slate mailing list