summaryrefslogtreecommitdiff
path: root/src/alloc.c
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 /src/alloc.c
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 'src/alloc.c')
-rw-r--r--src/alloc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 79ed1dd5f..35fdd00c4 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -29,3 +29,12 @@ int git_allocator_setup(git_allocator *allocator)
memcpy(&git__allocator, allocator, sizeof(*allocator));
return 0;
}
+
+#if !defined(GIT_MSVC_CRTDBG)
+int git_win32_crtdbg_init_allocator(git_allocator *allocator)
+{
+ GIT_UNUSED(allocator);
+ giterr_set(GIT_EINVALID, "crtdbg memory allocator not available");
+ return -1;
+}
+#endif