summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2006-12-23 02:33:35 -0500
committerJunio C Hamano <junkio@cox.net>2006-12-29 11:36:44 -0800
commit77ccc5bbd1bd403abd5f552be7210073bea856a6 (patch)
tree33d02d246bb50b1d91a15987e0466da21933ac36 /sha1_file.c
parent4d703a1a9016cd0a08994ddf7fc2f4739f223112 (diff)
downloadgit-77ccc5bbd1bd403abd5f552be7210073bea856a6.tar.gz
Introduce new config option for mmap limit.
Rather than hardcoding the maximum number of bytes which can be mmapped from pack files we should make this value configurable, allowing the end user to increase or decrease this limit on a per-repository basis depending on the size of the repository and the capabilities of their operating system. In general users should not need to manually tune such a low-level setting within the core code, but being able to artifically limit the number of bytes which we can mmap at once from pack files will make it easier to craft test cases for the new mmap sliding window implementation. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 4824a5d4d8..4183f595ed 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -397,7 +397,6 @@ static char *find_sha1_file(const unsigned char *sha1, struct stat *st)
return NULL;
}
-#define PACK_MAX_SZ (1<<26)
static int pack_used_ctr;
static unsigned long pack_mapped;
struct packed_git *packed_git;
@@ -490,7 +489,7 @@ int use_packed_git(struct packed_git *p)
struct pack_header *hdr;
pack_mapped += p->pack_size;
- while (PACK_MAX_SZ < pack_mapped && unuse_one_packed_git())
+ while (packed_git_limit < pack_mapped && unuse_one_packed_git())
; /* nothing */
fd = open(p->pack_name, O_RDONLY);
if (fd < 0)