allocation_tracer 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/allocation_tracer/allocation_tracer.c +2 -6
- data/lib/allocation_tracer/version.rb +1 -1
- data/spec/allocation_tracer_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 074616cf05a960aad7ae31bef26b74114a57a244
|
4
|
+
data.tar.gz: c1d299d0e76a959847cb29e5a6b5a1ff937aeb21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c61c33f45023056481a8a49c428c93b31c8c64f22846b8bb3db5434c6c6a6d8f74ec8f6d60fed9e72777bc4f41442f8a0569ee0934097c11639113b9bbc24e4
|
7
|
+
data.tar.gz: d25df919f3141ce25176889538c0371b27fd3a4c66559e6455b26156a3e17a12dcba099763147d41e570a72418399f37bf7aec2c13f9d3c26ee1d3276db018d6
|
@@ -875,12 +875,10 @@ allocation_tracer_allocated_count_table(VALUE self)
|
|
875
875
|
{
|
876
876
|
struct traceobj_arg * arg = get_traceobj_arg();
|
877
877
|
VALUE h = rb_hash_new();
|
878
|
-
VALUE type;
|
879
878
|
int i;
|
880
879
|
|
881
880
|
for (i=0; i<T_MASK; i++) {
|
882
|
-
|
883
|
-
rb_hash_aset(h, ID2SYM(type), SIZET2NUM(arg->allocated_count_table[i]));
|
881
|
+
rb_hash_aset(h, type_sym(i), SIZET2NUM(arg->allocated_count_table[i]));
|
884
882
|
}
|
885
883
|
|
886
884
|
return h;
|
@@ -891,12 +889,10 @@ allocation_tracer_freed_count_table(VALUE self)
|
|
891
889
|
{
|
892
890
|
struct traceobj_arg * arg = get_traceobj_arg();
|
893
891
|
VALUE h = rb_hash_new();
|
894
|
-
VALUE type;
|
895
892
|
int i;
|
896
893
|
|
897
894
|
for (i=0; i<T_MASK; i++) {
|
898
|
-
|
899
|
-
rb_hash_aset(h, ID2SYM(type), SIZET2NUM(arg->freed_count_table[i]));
|
895
|
+
rb_hash_aset(h, type_sym(i), SIZET2NUM(arg->freed_count_table[i]));
|
900
896
|
}
|
901
897
|
|
902
898
|
return h;
|
@@ -249,4 +249,18 @@ describe ObjectSpace::AllocationTracer do
|
|
249
249
|
expect(table[:T_NONE]).to be nil
|
250
250
|
end
|
251
251
|
end
|
252
|
+
|
253
|
+
describe 'ObjectSpace::AllocationTracer.allocated_count_table' do
|
254
|
+
it 'should return a Hash object' do
|
255
|
+
h = ObjectSpace::AllocationTracer.allocated_count_table
|
256
|
+
expect(h[:T_NONE]).to be 0
|
257
|
+
end
|
258
|
+
end
|
259
|
+
|
260
|
+
describe 'ObjectSpace::AllocationTracer.freed_count_table' do
|
261
|
+
it 'should return a Hash object' do
|
262
|
+
h = ObjectSpace::AllocationTracer.freed_count_table
|
263
|
+
expect(h[:T_NONE]).to be 0
|
264
|
+
end
|
265
|
+
end
|
252
266
|
end
|