summaryrefslogtreecommitdiff
path: root/object.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-25 20:22:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-25 20:22:38 (GMT)
commit110240588d5c0ca88d3b55da52068f59d8d6367d (patch)
tree5a9120c2c70aeb9d2e7ac4347870094870019e49 /object.h
parentfa82bb70d9ef3acb6a47cddfb38a7b0ca40ac362 (diff)
parent14ba97f81c7b94e10d591b363688a073023f332d (diff)
downloadgit-110240588d5c0ca88d3b55da52068f59d8d6367d.zip
git-110240588d5c0ca88d3b55da52068f59d8d6367d.tar.gz
git-110240588d5c0ca88d3b55da52068f59d8d6367d.tar.bz2
Merge branch 'sb/object-store-alloc'
The conversion to pass "the_repository" and then "a_repository" throughout the object access API continues. * sb/object-store-alloc: alloc: allow arbitrary repositories for alloc functions object: allow create_object to handle arbitrary repositories object: allow grow_object_hash to handle arbitrary repositories alloc: add repository argument to alloc_commit_index alloc: add repository argument to alloc_report alloc: add repository argument to alloc_object_node alloc: add repository argument to alloc_tag_node alloc: add repository argument to alloc_commit_node alloc: add repository argument to alloc_tree_node alloc: add repository argument to alloc_blob_node object: add repository argument to grow_object_hash object: add repository argument to create_object repository: introduce parsed objects field
Diffstat (limited to 'object.h')
-rw-r--r--object.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/object.h b/object.h
index acc560b..47d1b49 100644
--- a/object.h
+++ b/object.h
@@ -1,6 +1,22 @@
#ifndef OBJECT_H
#define OBJECT_H
+struct parsed_object_pool {
+ struct object **obj_hash;
+ int nr_objs, obj_hash_size;
+
+ /* TODO: migrate alloc_states to mem-pool? */
+ struct alloc_state *blob_state;
+ struct alloc_state *tree_state;
+ struct alloc_state *commit_state;
+ struct alloc_state *tag_state;
+ struct alloc_state *object_state;
+ unsigned commit_count;
+};
+
+struct parsed_object_pool *parsed_object_pool_new(void);
+void parsed_object_pool_clear(struct parsed_object_pool *o);
+
struct object_list {
struct object *item;
struct object_list *next;
@@ -85,7 +101,7 @@ extern struct object *get_indexed_object(unsigned int);
*/
struct object *lookup_object(const unsigned char *sha1);
-extern void *create_object(const unsigned char *sha1, void *obj);
+extern void *create_object(struct repository *r, const unsigned char *sha1, void *obj);
void *object_as_type(struct object *obj, enum object_type type, int quiet);