summaryrefslogtreecommitdiff
path: root/include/git2/common.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-03-16 10:14:50 +0000
committerPatrick Steinhardt <ps@pks.im>2018-06-07 12:57:39 +0200
commit74b7ddbf333ee20a4b2bc7a0e7c3f7c2aa4fc590 (patch)
treec982f3373dc2f50a361e55798d524f9530c2483c /include/git2/common.h
parent9865cd1696ac4a3f47991a9a1d79b17cef5edc89 (diff)
downloadlibgit2-74b7ddbf333ee20a4b2bc7a0e7c3f7c2aa4fc590.tar.gz
settings: allow swapping out memory allocator
Tie in the newly created infrastructure for swapping out memory allocators into our settings code. A user can now simply use the new option "GIT_OPT_SET_ALLOCATOR" with `git_libgit2_opts`, passing in an already initialized allocator structure as vararg.
Diffstat (limited to 'include/git2/common.h')
-rw-r--r--include/git2/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index f65cfdd01..f095e5990 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -183,6 +183,7 @@ typedef enum {
GIT_OPT_GET_WINDOWS_SHAREMODE,
GIT_OPT_SET_WINDOWS_SHAREMODE,
GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION,
+ GIT_OPT_SET_ALLOCATOR
} git_libgit2_opt_t;
/**
@@ -345,6 +346,12 @@ typedef enum {
* > additional checksum calculation on each object. This defaults
* > to enabled.
*
+ * opts(GIT_OPT_SET_ALLOCATOR, git_allocator *allocator)
+ *
+ * > Set the memory allocator to a different memory allocator. This
+ * > allocator will then be used to make all memory allocations for
+ * > libgit2 operations.
+ *
* @param option Option key
* @param ... value to set the option
* @return 0 on success, <0 on failure