diff options
author | Vicent Martà <vicent@github.com> | 2012-09-06 01:17:23 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2012-09-06 01:17:23 -0700 |
commit | 7a3fc9fb175849a7ae55c88b4e0b3a5af58f5a22 (patch) | |
tree | a84c7302ef1f6b0ef3f34b266220c0774a535217 /include/git2 | |
parent | 4e2b8b4cdccc41f39a35c8e01578e0aa08c4f661 (diff) | |
parent | c49d328cf433da1bf25a97e3935069308daf7f8d (diff) | |
download | libgit2-7a3fc9fb175849a7ae55c88b4e0b3a5af58f5a22.tar.gz |
Merge pull request #900 from pwkelley/development
Expose a malloc function to 3rd party ODB backends
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/odb_backend.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h index b812fef1e..cb8069787 100644 --- a/include/git2/odb_backend.h +++ b/include/git2/odb_backend.h @@ -26,6 +26,10 @@ struct git_odb_stream; struct git_odb_backend { git_odb *odb; + /* read and read_prefix each return to libgit2 a buffer which + * will be freed later. The buffer should be allocated using + * the function git_odb_backend_malloc to ensure that it can + * be safely freed later. */ int (* read)( void **, size_t *, git_otype *, struct git_odb_backend *, @@ -102,6 +106,8 @@ GIT_EXTERN(int) git_odb_backend_pack(git_odb_backend **backend_out, const char * GIT_EXTERN(int) git_odb_backend_loose(git_odb_backend **backend_out, const char *objects_dir, int compression_level, int do_fsync); GIT_EXTERN(int) git_odb_backend_one_pack(git_odb_backend **backend_out, const char *index_file); +GIT_EXTERN(void *) git_odb_backend_malloc(git_odb_backend *backend, size_t len); + GIT_END_DECL #endif |