Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Unified Diff: src/heap.h

Issue 173465: Only pass idle notifications on from the API if V8 has been... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
===================================================================
--- src/heap.h (revision 2754)
+++ src/heap.h (working copy)
@@ -843,38 +843,8 @@
}
// Can be called when the embedding application is idle.
- static bool IdleNotification() {
- static const int kIdlesBeforeCollection = 7;
- static int number_idle_notifications = 0;
- static int last_gc_count = gc_count_;
+ static bool IdleNotification();
- bool finished = false;
-
- if (last_gc_count == gc_count_) {
- number_idle_notifications++;
- } else {
- number_idle_notifications = 0;
- last_gc_count = gc_count_;
- }
-
- if (number_idle_notifications >= kIdlesBeforeCollection) {
- // The first time through we collect without forcing compaction.
- // The second time through we force compaction and quit.
- bool force_compaction =
- number_idle_notifications > kIdlesBeforeCollection;
- CollectAllGarbage(force_compaction);
- last_gc_count = gc_count_;
- if (force_compaction) {
- number_idle_notifications = 0;
- finished = true;
- }
- }
-
- // Uncommit unused memory in new space.
- Heap::UncommitFromSpace();
- return finished;
- }
-
// Declare all the root indices.
enum RootListIndex {
#define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex,
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698