[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inferno and UNIX / to C or to GC, that is the question.

> * A program that allocates lots of circular lists will typically
> never see them collected.  Likewise for doubly-linked lists.

Great Circle claims to handle these.  I'm careful enough that I've never
tested it, however, I don't see why it *wouldn't* work, because --

> * A large program filled with random numbers can make it
> unlikely that conservative GC will be able to deallocate
> anything.  

Most garbage collectors for C++, including GC, allow you to allocate leaf
memory which is not scanned.  The only requirement is (obviously) that this
memory be guaranteed not to contain pointers, and that's your responsibility. 
 This is useful if you're working with large in-memory graphics or data sets
(in fact, it pretty much reduces your scanned area to your working set).

[.. good example of where this might be useful]

> So, you can't write a strict C implementation
> that will guarentee that all legal programs will work.
> A C implementation might still be useful, though.

As with everything, you can break it, but for the most part, the cases which
break garbage collection also make manual memory management a pain in the neck
(and usually, the result is lots of memory leaks..)