My mental image was that only the function that created the object should free it when it goes out of scope (and the compiler has to keep track of this).
It would be desirable to also be able to return such objects, and have the caller somehow take over the "creator" responsibility. (For tail calls, one would also like pass over the responsibility to the called function).
But this ought to be described somewhere in the gc literature.
/ Niels Möller (vässar rödpennan)
Previous text:
2004-02-05 15:20: Subject: Re: Default backend and thread backends?
A problem is how you know when the object goes out of scope. When an inner function returns, it shouldn't free the object even if the bit is clear.
You could avoid freeing objects that are in the function arguments, but as soon as they (or anything inside them) get referenced from other local variables, you don't know anymore and have to set the bit to be on the safe side.
/ Martin Stjernholm, Roxen IS