[EMAIL PROTECTED] wrote:
Author: cfbolz
Date: Thu Mar 16 15:02:22 2006
New Revision: 24466

Modified:
   pypy/dist/pypy/rpython/memory/gctransform.py
   pypy/dist/pypy/rpython/memory/test/test_gctransform.py
Log:
fix the quite broken gc_(un)protect code:

1)
  * raise NotImplementedError in the base class, since (un)protect does not
    make sense for most gcs

2)
  * make sure that the new operation introduced by replace_gc_(un)protect has
    the same result variable as the replaced operation. Otherwise we will end
    up with graphs that are missing a variable.

I agree that 2) is needed, although I don't understand it really,
'cause I thought the result of the operation would be never used.

But I don't agree on 1). Maybe I need to learn more about
garbage collectors.
Are you saying that there exist GCs where I cannot protect an object?
It the operation is not necessary because the object will survive
anyway, then it is perfectly fine.
If you have a compacting GC, the protect operation makes very much
sense, too, but needs a different implementation of course.

After all, I agree that raising NotImplemented is right, because
itreally would need to be implemented. Still I can't see how
it "does not make sense for most GCs". It makes sense for those
which I know and use.

--
Christian Tismer             :^)   <mailto:[EMAIL PROTECTED]>
tismerysoft GmbH             :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9A     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 802 86 56  mobile +49 173 24 18 776  fax +49 30 80 90 57 05
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
     whom do you want to sponsor today?   http://www.stackless.com/
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to