summaryrefslogtreecommitdiff
path: root/src/odb.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-04-15 00:05:44 -0700
committerVicent Marti <tanoku@gmail.com>2013-04-22 16:51:40 +0200
commit786062639f05e361da977f3f1f6286141fa12fca (patch)
tree5dc63d86657681572376ef2bced9bb2cae8e2213 /src/odb.h
parent917f60c50bce09f789aeb927b45ba3bca5a23877 (diff)
downloadlibgit2-786062639f05e361da977f3f1f6286141fa12fca.tar.gz
Add callback to git_objects_table
This adds create and free callback to the git_objects_table so that more of the creation and destruction of objects can be table driven instead of using switch statements. This also makes the semantics of certain object creation functions consistent so that we can make better use of function pointers. This also fixes a theoretical error case where an object allocation fails and we end up storing NULL into the cache.
Diffstat (limited to 'src/odb.h')
-rw-r--r--src/odb.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/odb.h b/src/odb.h
index 22c6e1668..0d9f9e2ea 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -39,8 +39,6 @@ struct git_odb {
git_cache own_cache;
};
-void git_odb_object__free(git_odb_object *object);
-
/*
* Hash a git_rawobj internally.
* The `git_rawobj` is supposed to be previously initialized
@@ -98,4 +96,7 @@ int git_odb__read_header_or_object(
git_odb_object **out, size_t *len_p, git_otype *type_p,
git_odb *db, const git_oid *id);
+/* fully free the object; internal method, DO NOT EXPORT */
+void git_odb_object__free(void *object);
+
#endif