path: root/delta.h
diff options
authorBrian Downing <>2007-07-12 12:55:48 (GMT)
committerJunio C Hamano <>2007-07-12 21:32:35 (GMT)
commit11779e79078c9da604753e570d02134c8d4bae6a (patch)
tree27449276ffd360c6947fe778d526934b6348a12f /delta.h
parenta1dab41af4c575bb72231c73df26ecb2af4814d6 (diff)
Support fetching the memory usage of a delta index
Delta indices, at least on 64-bit platforms, tend to be larger than the actual uncompressed data. As such, keeping track of this storage is important if you want to successfully limit the memory size of your pack window. Squirrel away the total allocation size inside the delta_index struct, and add an accessor "sizeof_delta_index" to access it. Signed-off-by: Brian Downing <> Acked-by: Nicolas Pitre <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'delta.h')
1 files changed, 7 insertions, 0 deletions
diff --git a/delta.h b/delta.h
index 7b3f86d..40ccf5a 100644
--- a/delta.h
+++ b/delta.h
@@ -24,6 +24,13 @@ create_delta_index(const void *buf, unsigned long bufsize);
extern void free_delta_index(struct delta_index *index);
+ * sizeof_delta_index: returns memory usage of delta index
+ *
+ * Given pointer must be what create_delta_index() returned, or NULL.
+ */
+extern unsigned long sizeof_delta_index(struct delta_index *index);
* create_delta: create a delta from given index for the given buffer
* This function may be called multiple times with different buffers using