iseq_collector 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/ext/iseq_collector/extconf.rb +4 -0
- data/iseq_collector.gemspec +2 -0
- data/lib/iseq_collector/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65748299ec8c1bc18d1b2331297771eeecf8f3dd
|
4
|
+
data.tar.gz: d29f03e81016604d187f8353cf785e20564bcdde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42cc8cebb4387e286ba8aa17ea2b130b225e45405d913d28c698452b109e43c7030ef5e095e5e7c56078b68829177b95f13cb2975e518e4e48981953fffd0393
|
7
|
+
data.tar.gz: 12acb6034afd13b57f49059769a1f19eb31165bb4da0ae9af1c9bb967cc2ed69ec961a0af6c99a1ec7afea8366b7b661f55d32b0530816e6e4ceecd0377025c6
|
data/README.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# IseqCollector
|
2
2
|
|
3
|
-
|
3
|
+
This gem introduce several methdos to `ObjectSpace` to operate all of iseq objects in a process.
|
4
4
|
|
5
|
-
|
5
|
+
## Background
|
6
|
+
|
7
|
+
Ruby (MRI) 2.2 and erlier, all of bytecode (iseq: instruction sequence) are `RubyVM::InstructionSequence` objects and we can touch them with `ObjectSpace.each_object` method.
|
8
|
+
However Ruby 2.3 and later does not expose iseqs by `RubyVM::InstructionSequence`. You need to use `RubyVM::InstructionSequence.of(proc or method object)` to get `RubyVM::InstructionSequence` and it is impossible to get all of iseqs in a process.
|
9
|
+
|
10
|
+
This gem provides `ObjectSpace.each_iseq`, `ObjectSpace.count_iseq` and `ObjectSpace.memsize_of_all_iseq` to get all of iseqs in a process for Ruby 2.3, 2.4. Ruby 2.5 will provide same feature in `objspace` external lib.
|
6
11
|
|
7
12
|
## Installation
|
8
13
|
|
@@ -22,7 +27,11 @@ Or install it yourself as:
|
|
22
27
|
|
23
28
|
## Usage
|
24
29
|
|
25
|
-
|
30
|
+
`require 'iseq_collector'` adds the following singleton methods to `ObjectSpace` module.
|
31
|
+
|
32
|
+
* `ObjectSpace.each_iseq{|iseq| ...}`
|
33
|
+
* `ObjectSpace.count_iseq #=> Integer`
|
34
|
+
* `ObjectSpace.memsize_of_all_iseq #=> Integer` (this feature can be implemented by `ObjectSpace.each_iseq`)
|
26
35
|
|
27
36
|
## Development
|
28
37
|
|
data/iseq_collector.gemspec
CHANGED
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
+
spec.extensions = ['ext/iseq_collector/extconf.rb']
|
25
|
+
|
24
26
|
spec.add_development_dependency "bundler", "~> 1.14"
|
25
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
28
|
spec.add_development_dependency "minitest", "~> 5.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iseq_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koichi Sasada
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,7 +70,8 @@ description: ISeq collector for MRI 2.3 and 2.4
|
|
70
70
|
email:
|
71
71
|
- ko1@atdot.net
|
72
72
|
executables: []
|
73
|
-
extensions:
|
73
|
+
extensions:
|
74
|
+
- ext/iseq_collector/extconf.rb
|
74
75
|
extra_rdoc_files: []
|
75
76
|
files:
|
76
77
|
- ".gitignore"
|
@@ -81,6 +82,7 @@ files:
|
|
81
82
|
- Rakefile
|
82
83
|
- bin/console
|
83
84
|
- bin/setup
|
85
|
+
- ext/iseq_collector/extconf.rb
|
84
86
|
- iseq_collector.gemspec
|
85
87
|
- lib/iseq_collector.rb
|
86
88
|
- lib/iseq_collector/version.rb
|
@@ -104,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
106
|
version: '0'
|
105
107
|
requirements: []
|
106
108
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
109
|
+
rubygems_version: 2.6.11
|
108
110
|
signing_key:
|
109
111
|
specification_version: 4
|
110
112
|
summary: ISeq collector for MRI 2.3 and 2.4
|