bigfile/py/loadblk: Resort to pybuf unpinninf, if nothing helps
There are situations possible when both exc_traceback and frame objects are garbage-collected, but frame's f_locals remains not collected because e.g. it was explicitly added to somewhere. We cannot detect such cases (dicts are not listed in referrers). So if nothing helped, as a last resort, unpin pybuf from its original memory and make it point to zero-sized NULL. In general this is not strictly correct to do as other buffers & memoryview objects created from pybuf, copy its pointer on initialization and thus pybuf unpinning won't adjust them. However we require BigFile implementations to make sure not to use such-created objects, if any, after return from loadblk(). Finally fixes nexedi/wendelin.core#7
Showing
Please register or sign in to comment