nakayoshi_fork 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbd5b16ca6ba975467e87a88a25fab44ff12cdf6
4
- data.tar.gz: 56a78a2c19dc85a84cd21b3073a7d08e28907ee2
3
+ metadata.gz: 47978bf9380f41c2546466d79bf4ba1fededee66
4
+ data.tar.gz: 692357d4bfecdb1920048ff7e122394ef8b43cef
5
5
  SHA512:
6
- metadata.gz: a2ea7583d349bbaa7b7e2a647cbfe7fbef280acd7e6583c3f82bcd177df64867774863cc99477d84ead799e6466000f84d19f99dbb13d8422c1c86136ffdc76f
7
- data.tar.gz: d5f598c8fd57e3af35505f51a9fe5fd4cd3ad7c9e9b4a753f1a613463323efeb1ebca57a2d78aff723476c35e7d28430ff701e8c237cd5ea0a692940ce03dfa9
6
+ metadata.gz: 28e162c46373b6ee779102b05e98e9bca5b4a517b496905817925fed400a0a89cafe6f3c2f8b071a2db88c86179d85603436bc59eb938a780f3b73cad60776dd
7
+ data.tar.gz: 2cebec608dd8d5d5c76b25a69d14e2b013a78924545ea3b2e85da86f4c07817c6f1abac699e621695f8b61cb4db0de0278df2dffbb7b6974d7f1371cd89d3604
@@ -4,14 +4,20 @@ module NakayoshiFork
4
4
  def fork(nakayoshi: true, cow_friendly: true, &b)
5
5
  if nakayoshi && cow_friendly
6
6
  h = {}
7
- 3.times{ # maximum 3 times
7
+ 4.times{ # maximum 4 times
8
8
  GC.stat(h)
9
9
  live_slots = h[:heap_live_slots] || h[:heap_live_slot]
10
10
  old_objects = h[:old_objects] || h[:old_object]
11
11
  remwb_unprotects = h[:remembered_wb_unprotected_objects] || h[:remembered_shady_object]
12
12
  young_objects = live_slots - old_objects - remwb_unprotects
13
+
14
+ # p [[live_slots, old_objects, remwb_unprotects], [young_objects]]
15
+
13
16
  break if young_objects < live_slots / 10
17
+
18
+ disabled = GC.enable
14
19
  GC.start(full_mark: false)
20
+ GC.disable if disabled
15
21
  }
16
22
  end
17
23
 
@@ -1,3 +1,3 @@
1
1
  module NakayoshiFork
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakayoshi_fork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada