[webkit-dev] WTF::fastMalloc

Geoffrey Garen ggaren at apple.com
Tue Oct 1 15:11:11 PDT 2013

>> (4) Find a fast API for aligned virtual memory allocation.
>> (5) Find a fast API for committing / decommitting physical memory without releasing virtual memory pages.
> Hrm. Isn't this already available via OSAllocator or are you referring
> to the fact that the Posix implementation has a few problems?

OSAllocator is the right model, yes. 

There are two problems with the current OSAllocator POSIX implementation:

(1) It uses mmap, which doesn’t support aligned allocation. To get aligned allocation, POSIX double-allocates all virtual memory. That is 2X too much. So, we need to find a variation on mmap that supports an alignment constraint.

(2) POSIX uses MADV_FREE, MADV_DONTNEED, and/or MADV_WILLNEED. I don’t think anybody has ever verified that these APIs do what we want. In my experience, they usually don’t. So, we need to find a variation on these APIs that works and is fast.

We need somebody to resolve these issues, otherwise our memory footprint will be unacceptably high, and/or our VM operations will be unacceptably slow.


More information about the webkit-dev mailing list