• Tim Peters's avatar
    visit_decref(): Two optimizations. · 93cd83e4
    Tim Peters yazdı
    1. You're not supposed to call this with a NULL argument, although the
       docs could be clearer about that.  The other visit_XYZ() functions
       don't bother to check.  This doesn't either now, although it does
       assert non-NULL-ness now.
    
    2. It doesn't matter whether the object is currently tracked, so don't
       bother checking that either (if it isn't currently tracked, it may
       have some nonsense value in gc_refs, but it doesn't hurt to
       decrement gibberish, and it's cheaper to do so than to make everyone
       test for trackedness).
    
    It would be nice to get rid of the other tests on IS_TRACKED.  Perhaps
    trackedness should not be a matter of not being in any gc list, but
    should be a matter of being in a new "untracked" gc list.  This list
    simply wouldn't be involved in the collection mechanism.  A newly
    created object would be put in the untracked list.  Tracking would
    simply unlink it and move it into the gen0 list.  Untracking would do
    the reverse.  No test+branch needed then.  visit_move() may be vulnerable
    then, though, and I don't know how this would work with the trashcan.
    93cd83e4
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...