On Mon, 2007-11-12 at 20:17 -0800, steve uurtamo wrote:
> C
> garbage collection: free().

Well, that's not garbage collection. You will begin to notice
that if you are using shared data structures with different
lifetimes. The question that comes up again and again is "can
I free this structure here or does any part of my program hold
a private pointer to this piece of data?" It is sometimes
possible to group freeing objects (e.g., a compiler can free
data structures it needs to compile a function when the end
of the function is reached - this is called "arena freeing")
but not always.

> very fast.

And it's not fast either. Free() has a reputation of being
slow, and that's not surprising if you look at the way it is
almost always implemented: scanning a list of addresses in
order to amalgamate the newly freed memory with adjacent free
areas.

My personal experience is: if you can tolerate the 5-10% loss
in execution speed, a real garbage collector is invaluable.

Hellwig

_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to