[webkit-changes] cvs commit: JavaScriptCore/kjs collector.cpp
Maciej
mjs at opensource.apple.com
Fri Jul 8 20:23:14 PDT 2005
mjs 05/07/08 20:23:13
Modified: . ChangeLog
kjs collector.cpp
Log:
Reviewed by hyatt.
- When there are many live objects, GC less often, to try to make
GC cost proportional to garbage, not proportional to total memory used.
* kjs/collector.cpp:
(KJS::Collector::allocate):
Revision Changes Path
1.741 +10 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.740
retrieving revision 1.741
diff -u -r1.740 -r1.741
--- ChangeLog 8 Jul 2005 22:23:20 -0000 1.740
+++ ChangeLog 9 Jul 2005 03:23:12 -0000 1.741
@@ -1,3 +1,13 @@
+2005-07-08 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by hyatt.
+
+ - When there are many live objects, GC less often, to try to make
+ GC cost proportional to garbage, not proportional to total memory used.
+
+ * kjs/collector.cpp:
+ (KJS::Collector::allocate):
+
2005-07-08 Vicki Murley <vicki at apple.com>
Fix from Carsten Guenther, reviewed by Maciej
1.37 +4 -1 JavaScriptCore/kjs/collector.cpp
Index: collector.cpp
===================================================================
RCS file: /cvs/root/JavaScriptCore/kjs/collector.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- collector.cpp 19 May 2005 00:53:37 -0000 1.36
+++ collector.cpp 9 Jul 2005 03:23:13 -0000 1.37
@@ -93,7 +93,10 @@
// collect if needed
int numLiveObjects = heap.numLiveObjects;
- if (numLiveObjects - heap.numLiveObjectsAtLastCollect >= ALLOCATIONS_PER_COLLECTION) {
+ int liveAtLastCollect = heap.numLiveObjectsAtLastCollect;
+ int delta = numLiveObjects - liveAtLastCollect;
+ if ((delta >= 1000 && delta >= liveAtLastCollect) ||
+ numLiveObjects == KJS_MEM_LIMIT - 1) {
collect();
numLiveObjects = heap.numLiveObjects;
}
More information about the webkit-changes
mailing list