Module: Sheap::Collection
- Included in:
- Diff, Heap, HeapObjectCollection
- Defined in:
- lib/sheap.rb
Instance Method Summary collapse
- #arrays ⇒ Object
- #bignums ⇒ Object
- #callcaches ⇒ Object
- #callinfos ⇒ Object
- #class_named(name) ⇒ Object
- #classes ⇒ Object
- #complexes ⇒ Object
- #constcaches ⇒ Object
- #crefs ⇒ Object
- #datas ⇒ Object
- #files ⇒ Object
- #floats ⇒ Object
- #hashes ⇒ Object
- #icasses ⇒ Object
- #imemos ⇒ Object
- #instances_of(klass) ⇒ Object
-
#iseqs ⇒ Object
imemo types.
- #matches ⇒ Object
- #ments ⇒ Object
- #modules ⇒ Object
- #of_imemo_type(type) ⇒ Object
- #of_type(type) ⇒ Object
- #plain_objects ⇒ Object
- #rationals ⇒ Object
- #regexps ⇒ Object
- #strings ⇒ Object
- #structs ⇒ Object
- #symbols ⇒ Object
Instance Method Details
#arrays ⇒ Object
52 |
# File 'lib/sheap.rb', line 52 def arrays; of_type("ARRAY"); end |
#bignums ⇒ Object
62 |
# File 'lib/sheap.rb', line 62 def bignums; of_type("BIGNUM"); end |
#callcaches ⇒ Object
70 |
# File 'lib/sheap.rb', line 70 def callcaches; of_imemo_type("callcache"); end |
#callinfos ⇒ Object
72 |
# File 'lib/sheap.rb', line 72 def callinfos; of_imemo_type("callinfo"); end |
#class_named(name) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/sheap.rb', line 19 def class_named(name) filter do |obj| obj.json.include?(name) && obj.type_str == "CLASS" && obj.name == name end end |
#classes ⇒ Object
45 |
# File 'lib/sheap.rb', line 45 def classes; of_type("CLASS"); end |
#complexes ⇒ Object
66 |
# File 'lib/sheap.rb', line 66 def complexes; of_type("COMPLEX"); end |
#constcaches ⇒ Object
71 |
# File 'lib/sheap.rb', line 71 def constcaches; of_imemo_type("constcache"); end |
#crefs ⇒ Object
73 |
# File 'lib/sheap.rb', line 73 def crefs; of_imemo_type("cref"); end |
#datas ⇒ Object
56 |
# File 'lib/sheap.rb', line 56 def datas; of_type("DATA"); end |
#files ⇒ Object
57 |
# File 'lib/sheap.rb', line 57 def files; of_type("FILE"); end |
#floats ⇒ Object
64 |
# File 'lib/sheap.rb', line 64 def floats; of_type("FLOAT"); end |
#hashes ⇒ Object
51 |
# File 'lib/sheap.rb', line 51 def hashes; of_type("HASH"); end |
#icasses ⇒ Object
46 |
# File 'lib/sheap.rb', line 46 def icasses; of_type("ICLASS"); end |
#imemos ⇒ Object
48 |
# File 'lib/sheap.rb', line 48 def imemos; of_type("IMEMO"); end |
#instances_of(klass) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/sheap.rb', line 27 def instances_of(klass) addr = klass.address filter do |obj| obj.json.include?(addr) && obj.class_addr == addr end end |
#iseqs ⇒ Object
imemo types
69 |
# File 'lib/sheap.rb', line 69 def iseqs; of_imemo_type("iseq"); end |
#matches ⇒ Object
60 |
# File 'lib/sheap.rb', line 60 def matches; of_type("MATCH"); end |
#ments ⇒ Object
74 |
# File 'lib/sheap.rb', line 74 def ments; of_imemo_type("ment"); end |
#modules ⇒ Object
47 |
# File 'lib/sheap.rb', line 47 def modules; of_type("MODULE"); end |
#of_imemo_type(type) ⇒ Object
40 41 42 43 |
# File 'lib/sheap.rb', line 40 def of_imemo_type(type) type = type.to_s.downcase filter { |o| o.json.include?(type) && o.imemo_type == type } end |
#of_type(type) ⇒ Object
35 36 37 38 |
# File 'lib/sheap.rb', line 35 def of_type(type) type = type.to_s.upcase filter { |o| o.json.include?(type) && o.type_str == type } end |
#plain_objects ⇒ Object
54 |
# File 'lib/sheap.rb', line 54 def plain_objects; of_type("OBJECT"); end |
#rationals ⇒ Object
65 |
# File 'lib/sheap.rb', line 65 def rationals; of_type("RATIONAL"); end |
#regexps ⇒ Object
59 |
# File 'lib/sheap.rb', line 59 def regexps; of_type("REGEXP"); end |
#strings ⇒ Object
50 |
# File 'lib/sheap.rb', line 50 def strings; of_type("STRING"); end |
#structs ⇒ Object
55 |
# File 'lib/sheap.rb', line 55 def structs; of_type("STRUCT"); end |
#symbols ⇒ Object
63 |
# File 'lib/sheap.rb', line 63 def symbols; of_type("SYMBOL"); end |