Commit 8b09e507 authored by mjs's avatar mjs
Browse files

Reviewed by Geoff.

        
        - change garbage collection to happen at increments proportional to number of live objects, not always
        every 1000 allocations

        * kjs/collector.cpp:
        (KJS::Collector::allocate):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent f1623c9f
2006-09-28 Maciej Stachowiak <mjs@apple.com>
Reviewed by Geoff.
- change garbage collection to happen at increments proportional to number of live objects, not always
every 1000 allocations
* kjs/collector.cpp:
(KJS::Collector::allocate):
2006-09-28 Maciej Stachowiak <mjs@apple.com>
 
Reviewed by Mitz.
......
......@@ -116,7 +116,9 @@ void* Collector::allocate(size_t s)
// collect if needed
size_t numLiveObjects = heap.numLiveObjects;
if (numLiveObjects - heap.numLiveObjectsAtLastCollect >= ALLOCATIONS_PER_COLLECTION) {
size_t numLiveObjectsAtLastCollect = heap.numLiveObjectsAtLastCollect;
size_t numNewObjects = numLiveObjects - numLiveObjectsAtLastCollect;
if (numNewObjects >= ALLOCATIONS_PER_COLLECTION && numNewObjects >= numLiveObjectsAtLastCollect) {
collect();
numLiveObjects = heap.numLiveObjects;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment