]> khamidou — GitHub mirrors - electron.git/commitdiff
Discard the idle gc module.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 29 Jul 2013 12:34:07 +0000 (20:34 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 29 Jul 2013 12:34:07 +0000 (20:34 +0800)
atom.gyp
browser/atom/atom.coffee
common/api/atom_api_idle_gc.cc [deleted file]
common/api/atom_extensions.h

index 747425f1f1c7bbcd877137103b82965583ba8f59..edbc9a51c6400ec0a7696fbccae7880a0636d403 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
       'common/api/api_messages.h',
       'common/api/atom_api_clipboard.cc',
       'common/api/atom_api_clipboard.h',
-      'common/api/atom_api_idle_gc.cc',
       'common/api/atom_api_id_weak_map.cc',
       'common/api/atom_api_id_weak_map.h',
       'common/api/atom_api_shell.cc',
index 6385a01f95502a024f6dc422f4c909245891282f..cf86bf1a83391817a1682d583c286ef212d76da8 100644 (file)
@@ -7,9 +7,6 @@ if process.platform is 'win32'
   console.log = console.error = console.warn = process.log
   process.stdout.write = process.stderr.write = process.log
 
-# Enable idle gc.
-process.atomBinding('idle_gc').start()
-
 # Provide default Content API implementations.
 atom = {}
 
diff --git a/common/api/atom_api_idle_gc.cc b/common/api/atom_api_idle_gc.cc
deleted file mode 100644 (file)
index 5756979..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright (c) 2013 GitHub, Inc. All rights reserved.
-// Copyright (c) 2012, Ben Noordhuis <info@bnoordhuis.nl>.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "vendor/node/src/node.h"
-
-namespace {
-
-using v8::Arguments;
-using v8::FunctionTemplate;
-using v8::Handle;
-using v8::HandleScope;
-using v8::Object;
-using v8::String;
-using v8::Undefined;
-using v8::V8;
-using v8::Value;
-
-typedef enum { STOP, RUN, PAUSE } gc_state_t;
-
-int64_t interval;
-gc_state_t state;
-gc_state_t prev_state;
-uv_timer_t timer_handle;
-uv_check_t check_handle;
-uv_prepare_t prepare_handle;
-
-void Timer(uv_timer_t*, int) {
-  if (V8::IdleNotification()) state = PAUSE;
-}
-
-void Check(uv_check_t*, int) {
-  prev_state = state;
-}
-
-void Prepare(uv_prepare_t*, int) {
-  if (state == PAUSE && prev_state == PAUSE) state = RUN;
-  if (state == RUN) uv_timer_start(&timer_handle, Timer, interval, 0);
-}
-
-Handle<Value> Stop(const Arguments& args) {
-  state = STOP;
-  uv_timer_stop(&timer_handle);
-  uv_check_stop(&check_handle);
-  uv_prepare_stop(&prepare_handle);
-  return Undefined();
-}
-
-Handle<Value> Start(const Arguments& args) {
-  HandleScope scope;
-  Stop(args);
-
-  interval = args[0]->IsNumber() ? args[0]->IntegerValue() : 0;
-  if (interval <= 0) interval = 5000;  // Default to 5 seconds.
-
-  state = RUN;
-  uv_check_start(&check_handle, Check);
-  uv_prepare_start(&prepare_handle, Prepare);
-
-  return Undefined();
-}
-
-void Init(Handle<Object> obj) {
-  HandleScope scope;
-
-  uv_timer_init(uv_default_loop(), &timer_handle);
-  uv_check_init(uv_default_loop(), &check_handle);
-  uv_prepare_init(uv_default_loop(), &prepare_handle);
-  uv_unref(reinterpret_cast<uv_handle_t*>(&timer_handle));
-  uv_unref(reinterpret_cast<uv_handle_t*>(&check_handle));
-  uv_unref(reinterpret_cast<uv_handle_t*>(&prepare_handle));
-
-  obj->Set(String::New("stop"), FunctionTemplate::New(Stop)->GetFunction());
-  obj->Set(String::New("start"), FunctionTemplate::New(Start)->GetFunction());
-}
-
-NODE_MODULE(atom_common_idle_gc, Init)
-
-}  // namespace
index e575a37c7bc8150c1ef181639f3b8e52268d2c29..70194150e7ad244d7c90c8e0435162a4085dd9d0 100644 (file)
@@ -24,7 +24,6 @@ NODE_EXT_LIST_ITEM(atom_renderer_ipc)
 // Module names start with `atom_common_` can be used by both browser and
 // renderer processes.
 NODE_EXT_LIST_ITEM(atom_common_clipboard)
-NODE_EXT_LIST_ITEM(atom_common_idle_gc)
 NODE_EXT_LIST_ITEM(atom_common_id_weak_map)
 NODE_EXT_LIST_ITEM(atom_common_shell)
 NODE_EXT_LIST_ITEM(atom_common_v8_util)