aboutsummaryrefslogtreecommitdiffstats
path: root/object-store.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-07-14 15:03:59 -0700
committerJunio C Hamano <gitster@pobox.com>2022-07-14 15:03:59 -0700
commit73b9ef6ab18fa7c9631f24eba0c67357067a1267 (patch)
treee0f65b69d818f6725c2e3bcbbb702eb55d0134da /object-store.h
parentbe733e120016a076926da3491c0c77d439686933 (diff)
parentaaf81223f48f710a3b9a64cc84fac93deed806b6 (diff)
downloadgit-73b9ef6ab18fa7c9631f24eba0c67357067a1267.tar.gz
Merge branch 'hx/unpack-streaming'
Allow large objects read from a packstream to be streamed into a loose object file straight, without having to keep it in-core as a whole. * hx/unpack-streaming: unpack-objects: use stream_loose_object() to unpack large objects core doc: modernize core.bigFileThreshold documentation object-file.c: add "stream_loose_object()" to handle large object object-file.c: factor out deflate part of write_loose_object() object-file.c: refactor write_loose_object() to several steps unpack-objects: low memory footprint for get_data() in dry_run mode
Diffstat (limited to 'object-store.h')
-rw-r--r--object-store.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/object-store.h b/object-store.h
index 539ea43904..5222ee5460 100644
--- a/object-store.h
+++ b/object-store.h
@@ -46,6 +46,12 @@ struct object_directory {
char *path;
};
+struct input_stream {
+ const void *(*read)(struct input_stream *, unsigned long *len);
+ void *data;
+ int is_finished;
+};
+
KHASH_INIT(odb_path_map, const char * /* key: odb_path */,
struct object_directory *, 1, fspathhash, fspatheq)
@@ -269,6 +275,8 @@ static inline int write_object_file(const void *buf, unsigned long len,
int write_object_file_literally(const void *buf, unsigned long len,
const char *type, struct object_id *oid,
unsigned flags);
+int stream_loose_object(struct input_stream *in_stream, size_t len,
+ struct object_id *oid);
/*
* Add an object file to the in-memory object store, without writing it