| 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,
|
|
|