From:  Nicholas Nethercote <>
Date:  02 Jan 2017 19:35:45 Hong Kong Time

Re: Use weak symbols instead of JS_USE_CUSTOM_ALLOCATOR


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
called jscustomallocator.h.


On Mon, Jan 2, 2017 at 10:17 PM,  wrote:

> Hello,
> 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
> cuntomization?
> Thanks for responses,
> Marek
> _______________________________________________
> dev-tech-js-engine-internals mailing list