autogc 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/autogc.gemspec +1 -1
- data/lib/autogc.rb +10 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/autogc.gemspec
CHANGED
data/lib/autogc.rb
CHANGED
@@ -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.
|
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:
|
113
|
+
hash: -1049707672990149169
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
none: false
|
116
116
|
requirements:
|