summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2006-06-30 04:38:55 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-30 06:48:31 (GMT)
commitfc046a75d539a78e6b2c16534c4078617a69a327 (patch)
tree03842bdfab234301a0a0c693f30c087a58eeb51f /object.c
parent8dbbd14ea3ae1b4e825f1e7d314afddf26c67298 (diff)
downloadgit-fc046a75d539a78e6b2c16534c4078617a69a327.zip
git-fc046a75d539a78e6b2c16534c4078617a69a327.tar.gz
git-fc046a75d539a78e6b2c16534c4078617a69a327.tar.bz2
Abstract out accesses to object hash array
There are a few special places where some programs accessed the object hash array directly, which bothered me because I wanted to play with some simple re-organizations. So this patch makes the object hash array data structures all entirely local to object.c, and the few users who wanted to look at it now get to use a function to query how many object index entries there can be, and to actually access the array. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'object.c')
-rw-r--r--object.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/object.c b/object.c
index 37784ce..31c77ea 100644
--- a/object.c
+++ b/object.c
@@ -5,9 +5,18 @@
#include "commit.h"
#include "tag.h"
-struct object **objs;
-static int nr_objs;
-int obj_allocs;
+static struct object **objs;
+static int nr_objs, obj_allocs;
+
+unsigned int get_max_object_index(void)
+{
+ return obj_allocs;
+}
+
+struct object *get_indexed_object(unsigned int idx)
+{
+ return objs[idx];
+}
const char *type_names[] = {
"none", "blob", "tree", "commit", "bad"