Skip to content

Commit 40199ba

Browse files
committed
refact(util): ask global util.mman from mman module
1 parent c63db69 commit 40199ba

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

Diff for: gitdb/util.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,11 @@
1414
import sys
1515

1616
from smmap import (
17-
StaticWindowMapManager,
18-
SlidingWindowMapManager,
17+
managed_mmaps,
1918
SlidingWindowMapBuffer
2019
)
2120

2221

23-
# initialize our global memory manager instance
24-
# Use it to free cached (and unused) resources.
25-
if sys.version_info < (2, 6):
26-
mman = StaticWindowMapManager()
27-
else:
28-
mman = SlidingWindowMapManager()
29-
# END handle mman
30-
3122
#{ Aliases
3223

3324
hex_to_bin = binascii.a2b_hex
@@ -59,6 +50,9 @@
5950

6051
log = logging.getLogger(__name__)
6152

53+
#: Global MemoryManager, remember to ``mman.collect()`` it.
54+
mman = managed_mmaps(check_entered=False)
55+
6256
#{ compatibility stuff ...
6357

6458

0 commit comments

Comments
 (0)