There's an easier way. Define JS_USE_CUSTOM_ALLOCATOR and then you can
provide your own definitions of js_malloc et al, which must be in a file
On Mon, Jan 2, 2017 at 10:17 PM, wrote:
> is it a bad idea to declare js_malloc, js_calloc, js_realloc, js_free and
> js_strdup in js/public/Utility.h as weak symbols ("__attribute__((weak))")?
> This would allow to use own allocator functions during SpiderMonkey
> library link time.
> I know that weak symbols are not in C standard so it is not good for
> portability. Mainly I want to know if there could be some functional
> problems? And if SpiderMonkey maintainers are against this way of
> Thanks for responses,
> dev-tech-js-engine-internals mailing list