[DRAFT] Tried to add direct calls example, but init fails #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The natural thing for wasm is to call functions from JS directly or using
cwrap
, but I failed to do so.In short, this fails:
I tracked the problem inside libgit2.
The root of the issue is here: https://github.com/libgit2/libgit2/blob/main/src/util/str.c#L86
This grealloc call (which appears to use the stdalloc realloc) doesn't work,
new_ptr
becomes0
.May it be connected with some memory issues? Or did I screw up somewhere? ;)
This PR contains a few changes I made to use
git_repository_init
.Not intended for merging. Once I figure out the problem, I'll be able to submit a better variant.