Skip to content

Conversation

@jschwe
Copy link
Member

@jschwe jschwe commented Nov 12, 2025

This is a WIP PR to explore adding support for allocations using an allocator provided by the embedder.
In this PR this requirement is going to be somewhat relaxed, and we still add a feature flag for mimalloc, which makes handling the link dependency easier.

Notes:

  • -DJS_USE_CUSTOM_ALLOCATOR doesn't seem to be actually useful / maintained, since any custom implementation still need to copy lots of code from Utility.h
  • Some code does make assumption that moz_arena_ allocated pointers can be freed / re-alloced by unprefixed free(), this lead to a patch to StringBuffer.h
  • The mimalloc header is currently vendored, but hopefully upstream would accept a patch for the DEP_ syntax of passing the include directory to us.
    • An alternative could be if the embedder informs us via an environment variable of where to look for the header file(s). That might be the more generic solution

Signed-off-by: Jonathan Schwender <[email protected]>
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.

1 participant