heap_dump 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -0
- data/ext/heap_dump/heap_dump.c +25 -3
- data/lib/heap_dump/version.rb +1 -1
- metadata +7 -7
data/Rakefile
CHANGED
@@ -17,8 +17,22 @@ task :test => :compile do
|
|
17
17
|
aaa
|
18
18
|
end
|
19
19
|
|
20
|
+
class Fiber
|
21
|
+
def [](key)
|
22
|
+
local_fiber_variables[key]
|
23
|
+
end
|
24
|
+
def []=(key,value)
|
25
|
+
local_fiber_variables[key] = value
|
26
|
+
end
|
27
|
+
private
|
28
|
+
def local_fiber_variables
|
29
|
+
@local_fiber_variables ||= {}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
require 'fiber'
|
20
33
|
Fiber.new{
|
21
34
|
fiber_var = :some_fiber_var
|
35
|
+
Fiber.current[:some_fiber_ivar] = :ivar_cool_value
|
22
36
|
some_meth
|
23
37
|
Fiber.yield e
|
24
38
|
fiber_var = :some_fiber_var3
|
data/ext/heap_dump/heap_dump.c
CHANGED
@@ -903,7 +903,27 @@ static inline void walk_live_object(VALUE obj, walk_ctx_t *ctx){
|
|
903
903
|
//RVALUE etc. has file/line info in this case
|
904
904
|
#endif
|
905
905
|
|
906
|
-
|
906
|
+
yg_cstring("class");
|
907
|
+
yg_id(rb_class_of(obj));
|
908
|
+
|
909
|
+
//ivars for !(obj|class|module):
|
910
|
+
// if (FL_TEST(obj, FL_EXIVAR) || rb_special_const_p(obj))
|
911
|
+
// return generic_ivar_get(obj, id, warn);
|
912
|
+
|
913
|
+
const int bt_type = BUILTIN_TYPE(obj);
|
914
|
+
|
915
|
+
// for generic types ivars are held separately in a table
|
916
|
+
if(bt_type != T_OBJECT && bt_type != T_CLASS && bt_type != T_MODULE && bt_type != T_ICLASS){
|
917
|
+
st_table* generic_tbl = rb_generic_ivar_table(obj);
|
918
|
+
if(generic_tbl){
|
919
|
+
yg_cstring("generic_ivars");
|
920
|
+
yg_map();
|
921
|
+
st_foreach(generic_tbl, dump_iv_entry, (st_data_t)ctx);
|
922
|
+
yg_map_end();
|
923
|
+
}
|
924
|
+
}
|
925
|
+
|
926
|
+
switch(bt_type){ // no need to call TYPE(), as value is on heap
|
907
927
|
case T_NODE:
|
908
928
|
dump_node(RNODE(obj), ctx);
|
909
929
|
break;
|
@@ -947,8 +967,10 @@ static inline void walk_live_object(VALUE obj, walk_ctx_t *ctx){
|
|
947
967
|
break;
|
948
968
|
|
949
969
|
case T_OBJECT:
|
950
|
-
yg_cstring("class");
|
951
|
-
yg_id(rb_class_of(obj));
|
970
|
+
//yg_cstring("class");
|
971
|
+
//yg_id(rb_class_of(obj));
|
972
|
+
|
973
|
+
|
952
974
|
// yg_cstring("refs"); //ivars
|
953
975
|
// yajl_gen_array_open(ctx->yajl);
|
954
976
|
// {
|
data/lib/heap_dump/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heap_dump
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-06-12 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ruby-internal
|
16
|
-
requirement: &
|
16
|
+
requirement: &70260603589660 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.8.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70260603589660
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yajl-ruby
|
27
|
-
requirement: &
|
27
|
+
requirement: &70260603587520 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70260603587520
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake-compiler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70260603586460 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70260603586460
|
47
47
|
description: dump ruby 1.9 heap contents
|
48
48
|
email:
|
49
49
|
- vasilyfedoseyev@gmail.com
|