bmalloc should honor the FastMalloc statistics API
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 00:16:18 +0000 (00:16 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 6 Sep 2014 00:16:18 +0000 (00:16 +0000)
commit01f6c6fbee0097ae093ebe7ce322ad90658749e9
tree9117f31bf5cd6b488e1bd0ca9d3d6c392b15c3d9
parent0132a2727a917d53a28c2dfa4903ec094cabb06f
bmalloc should honor the FastMalloc statistics API
https://bugs.webkit.org/show_bug.cgi?id=136592

Reviewed by Gavin Barraclough.

Source/bmalloc:

We do this by tracking "size" and "capacity" in the VM heap.

The VM heap's "capacity" is all the VM we ever allocated.

The VM heap's "size" the subset of VM currently held onto by the
VM heap (and therefore not in use by the regular heap).

Somewhat ironically, reducing the process's memory footprint, increases
the size of the VM heap, since the VM heap holds the pages that are
purely virtual and not physical.

* bmalloc/Heap.cpp:
(bmalloc::Heap::size):
(bmalloc::Heap::capacity):
* bmalloc/Heap.h:
* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::VMHeap):
(bmalloc::VMHeap::allocateSmallChunk):
(bmalloc::VMHeap::allocateMediumChunk):
(bmalloc::VMHeap::allocateLargeChunk):
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::size):
(bmalloc::VMHeap::capacity):
(bmalloc::VMHeap::allocateSmallPage):
(bmalloc::VMHeap::allocateMediumPage):
(bmalloc::VMHeap::allocateLargeRange):
(bmalloc::VMHeap::deallocateSmallPage):
(bmalloc::VMHeap::deallocateMediumPage):
(bmalloc::VMHeap::deallocateLargeRange):
* bmalloc/bmalloc.h:
(bmalloc::api::heapSize):
(bmalloc::api::heapCapacity):

Source/WTF:

* wtf/FastMalloc.cpp:
(WTF::fastMallocStatistics):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173346 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/FastMalloc.cpp
Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/Heap.cpp
Source/bmalloc/bmalloc/Heap.h
Source/bmalloc/bmalloc/VMHeap.cpp
Source/bmalloc/bmalloc/VMHeap.h
Source/bmalloc/bmalloc/bmalloc.h