On 3/30/09 4:00 AM, Nelson B Bolyard wrote:

> On Windows, the JEMalloc code can ONLY be built with the non-free
> "professional" version of Microsoft Visual Studio, and CANNOT be built
> with the free version.  Consequently, developers who use the free version
> must build EVERYTHING themselves, and cannot mix and match libraries they
> build with libraries they download from Mozilla's site.

What do you mean by everything? It is certainly possible to mix an extension
DLL compiled against the static CRT with Firefox compiled with the jemalloc
CRT. This is in fact the recommended configuration.

> Oh, it's worse than that.  It you link a shared library or executable
> with the "static" version of the c run time on Windows, then that
> shared library/executable has its own heap.  It's "free" is a different
> deallocator than the "free" in other shared libs.  So, unless you're
> careful to completely avoid linking with static C run time libraries,
> every library's "free" is a separate deallocator.  This wouldn't be so
> bad if everyone avoided using static c RTL, but Mozilla actually
> recommends that people DO use the static RTL, to work around the afore-
> mentioned problem with JEMalloc on Windows.  :(

Indeed. We also recommend that people don't pass allocated objects across
DLL boundaries without using a "common" allocator function such as
PR_Malloc/PR_Free or NS_Alloc/NS_Free. This is precisely why the Mozilla
platform has common allocator functions.

--BDS

-- 
dev-tech-crypto mailing list
dev-tech-crypto@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-crypto

Reply via email to