Block freeing thread should sleep indefinitely when there's no work to do
authormhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2012 21:24:19 +0000 (21:24 +0000)
committermhahnenberg@apple.com <mhahnenberg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2012 21:24:19 +0000 (21:24 +0000)
commitfa14b184af262bdb7b12d639d07ba508f43de7fa
tree3fa483afd8d24489949c08e8019469b60d02e65a
parent57fa41ff0a1816fa80c42caacfb6f63fa98d6c6b
Block freeing thread should sleep indefinitely when there's no work to do
https://bugs.webkit.org/show_bug.cgi?id=98084

Reviewed by Geoffrey Garen.

Currently the block freeing thread wakes up once a second to check if there are any blocks
for it to release back to the OS. This is wasteful. We should change it to sleep when it
realizes there are no more blocks to free. Any thread that returns a block to the BlockAllocator
should then notify the block freeing thread that there is more work to do now.

* heap/BlockAllocator.cpp:
(JSC::BlockAllocator::BlockAllocator):
(JSC::BlockAllocator::blockFreeingThreadMain):
* heap/BlockAllocator.h:
(BlockAllocator):
(JSC::BlockAllocator::deallocate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/heap/BlockAllocator.cpp
Source/JavaScriptCore/heap/BlockAllocator.h