summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ceb8442)
raw | patch | inline | side by side (parent: ceb8442)
author | Nicolas Pitre <nico@cam.org> | |
Mon, 19 Mar 2007 20:28:51 +0000 (16:28 -0400) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 20 Mar 2007 01:15:59 +0000 (18:15 -0700) |
Currently there are 3 different ways to deal with the cache size.
Let's stick to only one. The compiler is smart enough to produce the exact
same code in those cases anyway.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Let's stick to only one. The compiler is smart enough to produce the exact
same code in those cases anyway.
Signed-off-by: Nicolas Pitre <nico@cam.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 b0b21776e79cddcdbbf93b4ee6daed2abdf804c4..8a19d7ee29c24b4f3df229b7cffc186d85ae573a 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
hash = (unsigned long)p + (unsigned long)base_offset;
hash += (hash >> 8) + (hash >> 16);
- return hash & 0xff;
+ return hash % MAX_DELTA_CACHE;
}
static void *cache_or_unpack_entry(struct packed_git *p, off_t base_offset,
release_delta_base_cache(ent);
delta_base_cached += base_size;
for (i = 0; delta_base_cached > delta_base_cache_limit
- && i < ARRAY_SIZE(delta_base_cache); i++) {
+ && i < MAX_DELTA_CACHE ; i++) {
struct delta_base_cache_entry *f = delta_base_cache + i;
if (f->type == OBJ_BLOB)
release_delta_base_cache(f);
}
for (i = 0; delta_base_cached > delta_base_cache_limit
- && i < ARRAY_SIZE(delta_base_cache); i++)
+ && i < MAX_DELTA_CACHE ; i++)
release_delta_base_cache(delta_base_cache + i);
ent->p = p;