• Kirill Smelkov's avatar
    bigfile/py: Factor out code to "unpin" a buffer to separate functions · 3a8e1beb
    Kirill Smelkov authored
    This code was added in 6da5172e (bigfile/py: Teach storeblk() how to
    correctly propagate traceback on error) to unpin a storeblk pybuf to not
    care whether its refcount == 1 - this way to be able to propagate python
    error upper not caring whether pybuf is still referenced or not.
    
    9aa6a5d7 (bigfile/py: Teach loadblk() to automatically break reference
    cycles to pybuf) adds a note that such unpinning is not strictly
    correct: becuase of other buffer objects were created from pybuf - they
    are copying pointers on initialization and unpinning pybuf won't adjust
    them.
    
    However for loadblk codepath it turned out (see next patch) it is not
    completely possible to unreference pybuf in all cases. For this reason
    loadblk will be falling back to unpinning too.
    
    As a preparatory step move common code to shared functions.
    3a8e1beb
_bigfile.c 31.5 KB