2013/10/13 Nicholas Nethercote <[email protected]>:
> Hi,
>
> I want to add a precise memory reporting test.  One that uses the
> JSAPI to build some objects and strings whose exact size is knowable,
> so that I can check that the reported sizes match.  (We don't have
> anything like that currently.)
>
> The obvious way to do this is via a jsapi-test, but there's one big
> obstacle, which is that I need to be able to use jemalloc and
> moz_malloc_size_of() to get the size of various allocated heap blocks,
> and SpiderMonkey doesn't get linked with jemalloc or mozalloc.
>
> Another option is to do it all in a C++ browser unit test, which would
> give me jemalloc, but I need to access some functions and types that
> aren't visible via the JSAPI.
>
> So my current idea is to create a new function in the JSAPI called
> TestMemoryReporting(), which takes a MallocSizeOf function as a
> pointer.  I'd write a C++ browser unit test (which is linked with
> jemalloc, AIUI) and call TestMemoryReporting(), passing in
> moz_malloc_size_of().  That way I satisfy all my constraints.
>
> It's a bit ugly, but I can't see a better way to do it.  Any other
> suggestions?  Thanks.

I wonder if JS shell builds should (at least optionally) link with
mozalloc and jemalloc to better simulate browser conditions in our
everyday correctness and performance testing.

-- 
Regards,
Benjamin
_______________________________________________
dev-tech-js-engine-internals mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to