summaryrefslogtreecommitdiff
path: root/src/odb.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2012-11-19 22:23:16 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2012-11-30 15:55:23 +0100
commitf56f8585c095b1589b5e3dca0ea64ef907756fc9 (patch)
treed96a4a9296aa55d28135354d9cdc227e493b389c /src/odb.h
parent46635339e935ce59e5a3525e18228f259d141aa3 (diff)
downloadlibgit2-f56f8585c095b1589b5e3dca0ea64ef907756fc9.tar.gz
indexer: use the packfile streaming API
The new API allows us to read the object bit by bit from the packfile, instead of needing it all at once in the packfile. This also allows us to hash the object as it comes in from the network instead of having to try to read it all and failing repeatedly for larger objects. This is only the first step, but it already shows huge improvements when dealing with objects over a few megabytes in size. It reduces the memory needs in some cases, but delta objects still need to be completely in memory and the old inefficent method is still used for that.
Diffstat (limited to 'src/odb.h')
-rw-r--r--src/odb.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/odb.h b/src/odb.h
index e9e33dde8..ed4ee7e7c 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -46,6 +46,10 @@ struct git_odb {
int git_odb__hashobj(git_oid *id, git_rawobj *obj);
/*
+ * Format the object header such as it would appear in the on-disk object
+ */
+int git_odb__format_object_header(char *hdr, size_t n, size_t obj_len, git_otype obj_type);
+/*
* Hash an open file descriptor.
* This is a performance call when the contents of a fd need to be hashed,
* but the fd is already open and we have the size of the contents.