[m-dev.] for review: Accurate garbage collection.
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Jul 3 01:46:55 AEST 1998
On 02-Jul-1998, Tyson Dowd <trd at stimpy.cs.mu.oz.au> wrote:
> On 01-Jul-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> >
> > There are probably other calls to deep_copy() somewhere in extras/*.
> >
> > I think it would be better to leave the interface to deep_copy()
> > as is, if necessary by making deep_copy() a forwarding macro that
> > calls the function that actually does the work.
>
> Hmmm... There are problems.
>
> If you make deep_copy a forwarding macro,
>
> #define deep_copy(X, ...) deep_copy_internal(&X, ...)
>
> you need to introduce a local variable, because deep_copy is sometimes
> called with a register as an argument, and you can't take the address of
> a register.
>
> #define deep_copy(X, ...) \
> { Word local_value = X; deep_copy_internal(&X, ...) }
>
> but this doesn't work, because deep_copy returns a value.
>
> So you need to introduce a function. Not a catastrophe, but it seems a
> bit unnecessary.
>
> Is there any driving need for this backwards compatability?
No, it just seems conceptually wrong for deep_copy to take a pointer,
especially a non-const pointer, if it doesn't actually modify the argument.
Presumably you could solve this by introducing some additional macros
for the bits that are different between the different versions of copy()?
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list