summaryrefslogtreecommitdiff
path: root/repository.h
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-05-08 19:37:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-09 03:12:36 (GMT)
commit99bf115c879af7e38ef0ca9596fc9db1d6598d5f (patch)
tree1649347a2a4a8b94495b1d95782249f3943346d5 /repository.h
parent9d98354f48997faf8251c566d909957f6ae427d5 (diff)
downloadgit-99bf115c879af7e38ef0ca9596fc9db1d6598d5f.zip
git-99bf115c879af7e38ef0ca9596fc9db1d6598d5f.tar.gz
git-99bf115c879af7e38ef0ca9596fc9db1d6598d5f.tar.bz2
repository: introduce parsed objects field
Convert the existing global cache for parsed objects (obj_hash) into repository-specific parsed object caches. Existing code that uses obj_hash are modified to use the parsed object cache of the_repository; future patches will use the parsed object caches of other repositories. Another future use case for a pool of objects is ease of memory management in revision walking: If we can free the rev-list related memory early in pack-objects (e.g. part of repack operation) then it could lower memory pressure significantly when running on large repos. While this has been discussed on the mailing list lately, this series doesn't implement this. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repository.h')
-rw-r--r--repository.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/repository.h b/repository.h
index e6e00f5..6d19981 100644
--- a/repository.h
+++ b/repository.h
@@ -26,6 +26,15 @@ struct repository {
*/
struct raw_object_store *objects;
+ /*
+ * All objects in this repository that have been parsed. This structure
+ * owns all objects it references, so users of "struct object *"
+ * generally do not need to free them; instead, when a repository is no
+ * longer used, call parsed_object_pool_clear() on this structure, which
+ * is called by the repositories repo_clear on its desconstruction.
+ */
+ struct parsed_object_pool *parsed_objects;
+
/* The store in which the refs are held. */
struct ref_store *refs;