Skip to content

fix: include git2/sys/alloc.h for git_allocator on libgit2 1.8+#512

Open
eejd wants to merge 1 commit into
DeusData:mainfrom
eejd:fix/libgit2-sys-alloc-include
Open

fix: include git2/sys/alloc.h for git_allocator on libgit2 1.8+#512
eejd wants to merge 1 commit into
DeusData:mainfrom
eejd:fix/libgit2-sys-alloc-include

Conversation

@eejd

@eejd eejd commented Jun 19, 2026

Copy link
Copy Markdown

Problem

git_allocator was moved from the top-level git2.h into git2/sys/alloc.h
in libgit2 1.8.0. Building codebase-memory-mcp against libgit2 ≥ 1.8 fails:

internal/cbm/cbm.c:347:12: error: unknown type name 'git_allocator'

Fix

Add an explicit #include <git2/sys/alloc.h> immediately after
#include <git2.h> inside the HAVE_LIBGIT2 guard in
internal/cbm/cbm.c. The struct members (gmalloc, grealloc, gfree)
and the GIT_OPT_SET_ALLOCATOR option code are unchanged — the only
issue was the missing header.

Tested against

  • libgit2 1.9.4 (MacPorts, macOS / Apple Silicon)

🤖 Generated with Claude Code

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).
@DeusData

Copy link
Copy Markdown
Owner

Thanks @eejd — the git2/sys/alloc.h include for libgit2 1.8+ is correct. The only thing blocking is DCO: the commit's author email doesn't match its Signed-off-by email, so the DCO check fails. Could you re-sign with a matching identity — git commit --amend -s (with the author email equal to your sign-off email), or git rebase --signoff — then force-push? Once DCO is green I'll merge. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants