[webkit-help] What is the purpose of WTF::OSAllocator and WTF::fastMalloc in Webkit?
annulen at yandex.ru
Fri Dec 9 02:31:12 PST 2016
09.12.2016, 12:28, "fdgfd gfdgfdg" <probablynotthebestone at gmail.com>:
> There are two ways webkit gets memory using mmap from the operating system, one is WTF::OSAllocator and the second one is WTF::fastMalloc which seems to rely on tcmalloc to get memory from os. I'm using qt bindings. What is the purpose of each of them ?
OSAllocator has Usage enum in the beginning of its declaration, it lists primary cases where OSAllocator is used. Generally speaking, OSAllocator is used for large-sized allocations with sizes comparable to OS memory pages (typically 4K)
On the contrary, fastMalloc is used for smaller allocations, it's most common usage is WTF_MAKE_FAST_ALLOCATED macro which declares new and delete operators in a large number of classes, e.g. WebCore::Node.
> I'm using qt bindings.
You should better switch to , it's much closer to the modern WebKit, see  for more details.
In particular, tcmalloc is not used for a long time, it was superceeded by bmalloc. Since then, some usages of OSAllocator were replaced with bmalloc/fastMalloc
> webkit-help mailing list
> webkit-help at lists.webkit.org
More information about the webkit-help