- 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: https://svn.webkit.org/repository/webkit/trunk@16614
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+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.
// 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;
}