summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-04-09 05:06:28 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-04-10 19:48:14 (GMT)
commit57059091fad25427bce9b3d47e073ce0518d164b (patch)
tree9e51d626819d9eedc260a157774dc8fe1f06f5e4 /cache.h
parent8ff21b1a3307c7059ea1e00b5117a50a2bc5fec8 (diff)
downloadgit-57059091fad25427bce9b3d47e073ce0518d164b.zip
git-57059091fad25427bce9b3d47e073ce0518d164b.tar.gz
git-57059091fad25427bce9b3d47e073ce0518d164b.tar.bz2
get rid of num_packed_objects()
The coming index format change doesn't allow for the number of objects to be determined from the size of the index file directly. Instead, Let's initialize a field in the packed_git structure with the object count when the index is validated since the count is always known at that point. While at it let's reorder some struct packed_git fields to avoid padding due to needed 64-bit alignment for some of them. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/cache.h b/cache.h
index eb57507..5b67f4c 100644
--- a/cache.h
+++ b/cache.h
@@ -376,11 +376,12 @@ struct pack_window {
extern struct packed_git {
struct packed_git *next;
struct pack_window *windows;
- const void *index_data;
- off_t index_size;
off_t pack_size;
- time_t mtime;
+ const void *index_data;
+ size_t index_size;
+ uint32_t num_objects;
int index_version;
+ time_t mtime;
int pack_fd;
int pack_local;
unsigned char sha1[20];
@@ -431,7 +432,6 @@ extern void pack_report(void);
extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);
extern void unuse_pack(struct pack_window **);
extern struct packed_git *add_packed_git(const char *, int, int);
-extern uint32_t num_packed_objects(const struct packed_git *p);
extern const unsigned char *nth_packed_object_sha1(const struct packed_git *, uint32_t);
extern off_t find_pack_entry_one(const unsigned char *, struct packed_git *);
extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsigned long *);