summaryrefslogtreecommitdiff
path: root/include/git2/sys/odb_backend.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/sys/odb_backend.h')
-rw-r--r--include/git2/sys/odb_backend.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h
index 15c741577..6614dcf30 100644
--- a/include/git2/sys/odb_backend.h
+++ b/include/git2/sys/odb_backend.h
@@ -131,6 +131,17 @@ GIT_EXTERN(int) git_odb_init_backend(
*/
GIT_EXTERN(void *) git_odb_backend_data_alloc(git_odb_backend *backend, size_t len);
+/**
+ * Frees custom allocated ODB data. This should only be called when
+ * memory allocated using git_odb_backend_data_alloc is not returned
+ * to libgit2 because the backend encountered an error in the read
+ * function after allocation and did not return this data to libgit2.
+ *
+ * @param backend the ODB backend that is freeing this memory
+ * @param data the buffer to free
+ */
+GIT_EXTERN(void) git_odb_backend_data_free(git_odb_backend *backend, void *data);
+
/*
* Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.