[Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7? (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sun Sep 26 18:55:58 CEST 2010
- Previous message: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?
- Next message: [Python-Dev] Python development tools (Was: Goodbye)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 26.09.2010 12:54, schrieb Nick Coghlan:
On Sat, Sep 25, 2010 at 9:20 AM, Tim Peters <tim.peters at gmail.com> wrote: [MvL]
I think it would be possible to have two versions of PyGCREFSUNTRACKED, one being, say, -5. PyGCREFSUNTRACKEDANDKEEPITTHATWAY would be what you get when you call PyObjectGCUnTrack; the code to do automatic tracking/untracking based on contents would use some other new API (which would be non-public in 2.7.x).
Looks like a promising idea! gcmodule.c's ISTRACKED macro would have to change to check both states, and likewise the debug assert in visitreachable(). Given the intent is to restore the 2.6 state, perhaps it is the "UNTRACKALLOWRETRACK" optimisation that should get the new special value? Other than that, MvL's suggestion looks like a good idea.
It would work either way, of course.
Regards, Martin
- Previous message: [Python-Dev] PyObject_GC_UnTrack() no longer reliable in 2.7?
- Next message: [Python-Dev] Python development tools (Was: Goodbye)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]