From 21499d9ae9edccd18c64bf6b15f248575c3da95b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 5 Jul 2011 14:22:04 +0200 Subject: 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. --- git/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'git/util.py') 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 -- cgit v1.2.1