[webkit-help] tryFastMalloc usage

Fabrice Robinet cmg473 at motorola.com
Wed Mar 28 11:34:17 PDT 2012


Ah yes !, thanks Zoltan and Sriram.

On Wed, Mar 28, 2012 at 12:32 AM, Zoltan Horvath <zoltan at webkit.org> wrote:

>
> Hey,
>
> currently WebKit supports usage either of system-malloc or TCmalloc. It
> depends on your platform whether USE_SYSTEM_MALLOC macro is defined to 1 or
> not.
> By default WebKit builds with TCmalloc, but you can pass --system-malloc
> option to build-webkit and it will set the macro for you to 1.
>
> FastMalloc is only a wrapper, but you can find TCmalloc's implementation
> in FastMalloc.cpp.
>
> Cheers,
>
> <Zoltan>
>
>
>
>
> On Wed, 28 Mar 2012 01:50:24 +0200, Fabrice Robinet <cmg473 at motorola.com>
> wrote:
>
>  Hi group,
>>
>> In short: I wonder where tryFastMalloc should be used, and what's *really*
>> implemented in it (or should be).
>>
>> Longer story:
>> According to the .cpp, it is supposed to use a cache, which would justify
>> the "fast" in the function name.
>>
>> From FastMalloc.cpp
>>
>> // A malloc that uses a per-thread cache to satisfy small malloc requests.
>>
>> // (The time for malloc/free of a small object drops from 300 ns to 50
>> ns.)
>>
>> But looking at the current source tryFastMalloc looks to just wrap
>> malloc. (I just updated Chromium and thus WebCore too...),
>>
>> I have seen tryFastMalloc used in WebCore code that is not too old (like
>> WebGL),
>> so I believe it is not deprecated and *should* be used, so this raises a
>> couple of questions:
>>
>> Is current state of tryFastMalloc temporary in the sense that a cache will
>> be used eventually ?
>> Did I miss something about this cache in the implementation ?
>> Are there (updated) guidelines about the usage of tryFastMalloc ?
>>
>> Thanks,
>> Fabrice.
>>
> ______________________________**_________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/**mailman/listinfo.cgi/webkit-**help<http://lists.webkit.org/mailman/listinfo.cgi/webkit-help>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20120328/e163cdfe/attachment.html>


More information about the webkit-help mailing list