[comp.lang.c++] Modula-3 garbage collection

campbell@redsox.bsw.com (Larry Campbell) (08/06/89)

In article <3917@shlump.nac.dec.com> nadkarni@ashok.dec.com writes:
-In article <45901@oliveb.olivetti.com>, chase@Ozona.orc.olivetti.com (David Chase) writes...
->In article <779@redsox.bsw.com> campbell@redsox.UUCP (Larry Campbell) writes:
[me] Modula-3, by contrast, allows you to decide on a type-by-type basis whether
[me] objects of the type are to be GC'd or not.  This seems to me to be the best
[me] solution.

[chase] To be fair, this is only somewhat the case.  In code that is
[chase] explicitly declared as UNSAFE you are allowed to choose on a
[chase] type-by-type basis whether or not objects are GC'd or not.  In

[ashok] Not true as far as I recall. If I remember the report correctly, you CAN decide
[ashok] on a type by type basis whether to GC or not. The UNTRACED keyword is provided
[ashok] for this purpose. This is true even for SAFE modules. What you might be
[ashok] referring to is that untraced REFs can point to traced REFs (or is it the other
[ashok] way around ?) only in UNSAFE modules.

You can declare types UNTRACED in both safe and unsafe modules.  However,
you can only use DISPOSE in unsafe modules.

In any event, I think my original point still stands - Modula-3 gives you
garbage collection, but doesn't force it on you.

I've redirected followups to comp.lang.modula2, since the C++ folks are
probably losing interest in this thread...
-- 
Larry Campbell                          The Boston Software Works, Inc.
campbell@bsw.com                        120 Fulton Street
wjh12!redsox!campbell                   Boston, MA 02146