[gclist] Finalization, collection, etc.
Robert A Duff
bobduff@world.std.com
Fri, 15 Mar 1996 14:21:11 -0500
> GC-triggered finalization suffices in such a context, as leaving the
> scope of such stack-allocable values would cause their immediate
> collection and hence finalization. (If you nest scopes one variable
> at a time, I don't think that finalizers could become circular without
> losing stack-allocability; if cyclic declarations were permitted, I
> imagine that they could -- though it would be pretty blatant.)
>
> Would this be sufficient?
I'm not sure I understand it. How is this different from your basic
run-of-the-mill stack-based language like C, Pascal, Ada, etc. Well, in
C you can point from the heap to the stack, which is trouble. But you
can't in Pascal, and you can only do so in Ada by using a feature
specifically marked as "unsafe, system-dependent".
In all of those languages, you can put an object of type T on the stack,
and another one on the heap, and pass them both as parameters and so
forth.
(OK, "Go read la Lucassen's paper" is a fair answer. ;-) )
- Bob