FIX memoryview leaks and retrofit memory-manager as context-managers#33
FIX memoryview leaks and retrofit memory-manager as context-managers#33ankostis wants to merge 19 commits intogitpython-developers:masterfrom
Conversation
+ Possible fixing gitpython-developers#31 by stop decrement on destruction, rely only on `with...` resources. + feat(mmap): utility to check if regions have been closed (PY3-only).
+ Add PY3 compat utilities + doc(changes, tutorial): update on mman usage
+ doc(tutorial): update use-cases + doc(changes): new bullet.
+ feat(mman): report missed exits.
+ All gitdb TCs now pass without explit release!
1 similar comment
|
@Byron can you check these lines where a It took me the half month to realize that this is leaking badly, and I want you to check the history of this commits leading up to it, because I cannot understand whether they were mistake or intentional, and what would be the repercussions (ie, performance?). |
|
@ankostis Sorry for the very late reply. I am no holiday now, and am working through everything that piled up. |
|
Yes, it is a python-3 issue, because the destructors are not deterministic. Now, in python3, you can slice memmaps as if they were |
|
If using direct access would be a solution, then it probably should be used instead. Correctness over performance I would say. |
BREAKING API:
retrofit
git.util.mmanas context-manager,to release memory-mapped regions held.
The mmap-manager(s) are re-entrant, but not thread-safe context-manager(s),
to be used within a
with ...:block, ensuring any left-overs cursors are cleaned up.If not entered, :meth:
StaticWindowMapManager.make_cursor()and/or:meth:
WindowCursor.use_region()will scream.Get them from
smmap.managed_mmaps().Simplify :class:
SlidingWindowMapBufferas create/close context-manager(no
begin_access(), orend_access()).