summaryrefslogtreecommitdiff
path: root/git/util.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2011-07-05 14:22:04 +0200
committerSebastian Thiel <byronimo@gmail.com>2011-07-05 14:22:12 +0200
commit21499d9ae9edccd18c64bf6b15f248575c3da95b (patch)
treeaa05fba15213699b0bae990c6c9ee6549741d6fb /git/util.py
parentd37ef7770fbc22ce07634430d9a61516762a2724 (diff)
downloadgitpython-21499d9ae9edccd18c64bf6b15f248575c3da95b.tar.gz
util: added global sliding memory manager
pack: now using the global sliding memory manager. The current implementation uses assumes that packs are small enough to fit into memory right away, where the window size will be about 1 GB, as it never calls use_window() to assure the required offset actually exists. It will need to change to set the window appropriately.
Diffstat (limited to 'git/util.py')
-rw-r--r--git/util.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/git/util.py b/git/util.py
index a31e5865..0c018447 100644
--- a/git/util.py
+++ b/git/util.py
@@ -15,6 +15,12 @@ import time
import stat
import shutil
import tempfile
+from smmap import (
+ StaticWindowMapManager,
+ SlidingWindowMapBuffer
+ )
+
+
__all__ = ( "stream_copy", "join_path", "to_native_path_windows", "to_native_path_linux",
"join_path_native", "Stats", "IndexFileSHA1Writer", "Iterable", "IterableList",
@@ -64,6 +70,10 @@ except ImportError:
# will be handled in the main thread
pool = ThreadPool(0)
+# initialize our global memory manager instance
+# Use it to free cached (and unused) resources.
+mman = StaticWindowMapManager()
+
#} END globals