summaryrefslogtreecommitdiff
path: root/include/git2/sys/odb_backend.h
diff options
context:
space:
mode:
authorArthur Schreiber <schreiber.arthur@googlemail.com>2015-10-01 00:50:37 +0200
committerArthur Schreiber <schreiber.arthur@googlemail.com>2015-10-01 00:50:37 +0200
commitd3b29fb94bf1c1d0caec39b4a2c3d2061c63efec (patch)
tree2b8c5a5972d066c3c059d58b72e35ffa25511b1f /include/git2/sys/odb_backend.h
parentba1a5553e43c7d5853dda21b1fce2a32e0ce4fd2 (diff)
downloadlibgit2-d3b29fb94bf1c1d0caec39b4a2c3d2061c63efec.tar.gz
refdb and odb backends must provide `free` function
As refdb and odb backends can be allocated by client code, libgit2 can’t know whether an alternative memory allocator was used, and thus should not try to call `git__free` on those objects. Instead, odb and refdb backend implementations must always provide their own `free` functions to ensure memory gets freed correctly.
Diffstat (limited to 'include/git2/sys/odb_backend.h')
-rw-r--r--include/git2/sys/odb_backend.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h
index fe102ff3c..e423a9236 100644
--- a/include/git2/sys/odb_backend.h
+++ b/include/git2/sys/odb_backend.h
@@ -83,6 +83,10 @@ struct git_odb_backend {
git_odb_writepack **, git_odb_backend *, git_odb *odb,
git_transfer_progress_cb progress_cb, void *progress_payload);
+ /**
+ * Frees any resources held by the odb (including the `git_odb_backend`
+ * itself). An odb backend implementation must provide this function.
+ */
void (* free)(git_odb_backend *);
};