[webkit-dev] Question for people working on ports

yjzhang at cc.hut.fi yjzhang at cc.hut.fi
Fri Sep 30 13:57:45 PDT 2005

Hi Maciej,

in our(nokia) code, memory alloc/free in both Webcore and JavascriptCore is
entirely managed by the new malloc code, and we believe the performance is much
better after switching to new malloc.

For each class in Webcore/JavascriptCore, we add new and delete operators. 
There seems to be a lot of changes, but actually far less than expected because
of class inheritance.  We also upgraded to dl malloc version 2.8.2

Your solution is neat and elegant, and a fast prototype shows it also works in
Symbian :)  Prefix file is feasible in Codwarrior compiler (with option -prefix)
when building for emulator.  However, RVCT, the compiler used to build for
hardware, has some challenges with prefix files - it only supports one
preincluded file and the building system already added one. So maybe we have to
use the "ugly" way for the hardware build.


Yongjun Zhang

On Thu, 29 Sep 2005 15:35:58 -0700 Maciej Stachowiak <mjs at apple.com> wrote:

> On Sep 29, 2005, at 3:11 PM, Krzysztof Kowalczyk wrote:
> > On Windows, for example, malloc() is thread-safe by default so unless
> > there is a measurable speed gain in using the replacement, there's
> > little value in using something else.
> I guess I didn't explain the change very well. We already had a  
> version of malloc that was faster than most system malloc  
> implementations (definitively measured as such at least on MacOS X  
> and Symbian). However, it was not threadsafe, so it was used only in  
> selected places where we were sure it was safe. The new one is as  
> fast, but threadsafe, so it's ok to just indiscriminately use it  
> everywhere, and this leads to a speedup on OS X. The MacOS X system  
> malloc is in fact threadsafe and I imagine that is also the case on  
> other operating systems.
> It sounds like using a prefix file is probably a viable option, but  
> I'd like to hear from the Nokia guys first.
> Regards,
> Maciej
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at opendarwin.org
> http://www.opendarwin.org/mailman/listinfo/webkit-dev

More information about the webkit-dev mailing list