autogc 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/autogc.gemspec +1 -1
  3. data/lib/autogc.rb +10 -0
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.3
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "autogc"
8
- s.version = "0.0.1"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
@@ -3,11 +3,21 @@ class Autogc
3
3
  #Disables the normal GC and enables a timeout to automatically GC.
4
4
  def initialize(args = {})
5
5
  @args = args
6
+
7
+ puts "Starting Autogc." if @args[:debug]
6
8
  @args[:time] = 1
7
9
  @thread = Thread.new(&self.method(:gc_loop))
8
10
  GC.disable
9
11
  end
10
12
 
13
+ #Starts autogc if it is running on a known buggy environment.
14
+ def self.enable_for_known_buggy_env(args = {})
15
+ found = false
16
+ found = true if RUBY_VERSION == "1.9.3"
17
+ Autogc.new(args) if found
18
+ return found
19
+ end
20
+
11
21
  #Stops the garbage-collection on time and enables the normal GC.
12
22
  def stop
13
23
  GC.enable
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  segments:
112
112
  - 0
113
- hash: 559040666043329783
113
+ hash: -1049707672990149169
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  none: false
116
116
  requirements: