mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user