summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5faaf24)
raw | patch | inline | side by side (parent: 5faaf24)
author | Alexandre Julliard <julliard@winehq.org> | |
Wed, 14 Feb 2007 17:11:40 +0000 (18:11 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 14 Feb 2007 23:22:08 +0000 (15:22 -0800) |
This ensures that a given area is mapped at most twice, and greatly
reduces the virtual address space usage.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
reduces the virtual address space usage.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_file.c | patch | blob | history |
diff --git a/sha1_file.c b/sha1_file.c
index 8ad7fad825708b5a56a3bfd4b8b98708de0bb2dc..b83f59f38320b349fa873f0505e74ae2ba75a99b 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
static unsigned int pack_open_windows;
static size_t peak_pack_mapped;
static size_t pack_mapped;
-static size_t page_size;
struct packed_git *packed_git;
void pack_report()
"pack_report: getpagesize() = %10" SZ_FMT "\n"
"pack_report: core.packedGitWindowSize = %10" SZ_FMT "\n"
"pack_report: core.packedGitLimit = %10" SZ_FMT "\n",
- page_size,
+ (size_t) getpagesize(),
packed_git_window_size,
packed_git_limit);
fprintf(stderr,
break;
}
if (!win) {
- if (!page_size)
- page_size = getpagesize();
+ size_t window_align = packed_git_window_size / 2;
win = xcalloc(1, sizeof(*win));
- win->offset = (offset / page_size) * page_size;
+ win->offset = (offset / window_align) * window_align;
win->len = p->pack_size - win->offset;
if (win->len > packed_git_window_size)
win->len = packed_git_window_size;