Skip to content

Commit 586fc8a

Browse files
committed
fix: include git2/sys/alloc.h for git_allocator on libgit2 1.8+
git_allocator moved out of the top-level git2.h into git2/sys/alloc.h in libgit2 1.8.0. Add an explicit include so the mimalloc binding compiles against libgit2 >= 1.8 (e.g. MacPorts libgit2 1.9.4).
1 parent f0c9be1 commit 586fc8a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/cbm/cbm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
#if defined(CBM_BIND_TS_ALLOCATOR) && CBM_BIND_TS_ALLOCATOR
2121
#include "sqlite3.h" // sqlite3_mem_methods, sqlite3_config, SQLITE_CONFIG_MALLOC — bind sqlite to mimalloc
2222
#if defined(HAVE_LIBGIT2)
23-
#include <git2.h> // git_allocator, git_libgit2_opts, GIT_OPT_SET_ALLOCATOR — bind libgit2 to mimalloc
23+
#include <git2.h> // git_libgit2_opts, GIT_OPT_SET_ALLOCATOR — bind libgit2 to mimalloc
24+
/* git_allocator moved to sys/alloc.h in libgit2 1.8+; no longer in git2.h */
25+
#include <git2/sys/alloc.h>
2426
#endif
2527
#endif
2628
#include <stdint.h> // uint32_t, uint64_t, int64_t

0 commit comments

Comments
 (0)