allocation_tracer 0.0.3 → 0.0.5

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: 76c7a52b186ed762bc19644997b2d57e66fbb431
4
- data.tar.gz: 2b945274f4255f0c06374354a66bde0d0f3bcf13
3
+ metadata.gz: 7842f134236279f5daff085c04b6d213006d9c22
4
+ data.tar.gz: accc0258ea2a0f27859b9322fc9d244de413ff77
5
5
  SHA512:
6
- metadata.gz: 518dcab890b67dab01d987ef98a277c7364521777c5c9edef0057543cc34719a369ceec93d81c020dd96700894c0da3aeb582d2b19720e7b3fc5899f26543e18
7
- data.tar.gz: 6b7792f6f02388a69d4fb21a92b2cb9c94605125db49c14af5821fd5700c5be99b2b892c646300030130b25fad4b320a33bb65f100d50c7fe8ac92e9fee4cd86
6
+ metadata.gz: 5278e203b466d03ad3ed9af0229bcd3d0961f8657ceb7635253b3fe37854b23b6cd2e91821fc30ccbc96641fba334f9f219a247cb5d87bdc86ec9490dc345f11
7
+ data.tar.gz: 274eb069e103b48d9e6a99fbfbc99c7b416d244263008560c853a05dbd4ce878e70b636bdf0b6315b1e5583b21fb2c0fbb298caffd4beacba01df3f7284ef2a3
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.0
4
+
data/README.md CHANGED
@@ -8,6 +8,8 @@ focused on `age' of objects.
8
8
 
9
9
  This gem was separated from gc_tracer.gem.
10
10
 
11
+ [![Build Status](https://travis-ci.org/ko1/allocation_tracer.svg?branch=master)](https://travis-ci.org/ko1/allocation_tracer)
12
+
11
13
  ## Installation
12
14
 
13
15
  Add this line to your application's Gemfile:
@@ -156,3 +158,8 @@ test.rb 7 50000 41650 0 5
156
158
  3. Commit your changes (`git commit -am 'Add some feature'`)
157
159
  4. Push to the branch (`git push origin my-new-feature`)
158
160
  5. Create new Pull Request
161
+
162
+ ## Author
163
+
164
+ Koichi Sasada from Heroku, Inc.
165
+
@@ -219,6 +219,7 @@ newobj_i(VALUE tpval, void *data)
219
219
 
220
220
  info->next = NULL;
221
221
  info->living = 1;
222
+ info->memsize = 0;
222
223
  info->flags = RBASIC(obj)->flags;
223
224
  info->klass = RTEST(klass) ? rb_class_real(klass) : Qnil;
224
225
  info->generation = rb_gc_count();
@@ -300,9 +301,8 @@ aggregator_i(void *data)
300
301
  }
301
302
 
302
303
  static void
303
- move_to_freed_list(struct traceobj_arg *arg, VALUE obj, struct allocation_info *info)
304
+ move_to_freed_list(struct traceobj_arg *arg, struct allocation_info *info)
304
305
  {
305
- info->memsize = rb_obj_memsize_of(obj);
306
306
  info->next = arg->freed_allocation_info;
307
307
  arg->freed_allocation_info = info;
308
308
  }
@@ -320,7 +320,8 @@ freeobj_i(VALUE tpval, void *data)
320
320
  }
321
321
 
322
322
  if (st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) {
323
- move_to_freed_list(arg, obj, info);
323
+ info->memsize = rb_obj_memsize_of(obj);
324
+ move_to_freed_list(arg, info);
324
325
  st_delete(arg->object_table, (st_data_t *)&obj, (st_data_t *)&info);
325
326
  }
326
327
  }
@@ -444,7 +445,7 @@ aggregate_rest_object_i(st_data_t key, st_data_t val, void *data)
444
445
  {
445
446
  struct traceobj_arg *arg = (struct traceobj_arg *)data;
446
447
  struct allocation_info *info = (struct allocation_info *)val;
447
- move_to_freed_list(arg, (VALUE)key, info);
448
+ move_to_freed_list(arg, info);
448
449
  return ST_CONTINUE;
449
450
  }
450
451
 
@@ -1,3 +1,3 @@
1
1
  module ObjectSpace::AllocationTracer
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -27,7 +27,8 @@ describe ObjectSpace::AllocationTracer do
27
27
  it 'should acquire allocated memsize' do
28
28
  line = __LINE__ + 2
29
29
  result = ObjectSpace::AllocationTracer.trace do
30
- a = 'x' * 1234
30
+ 'x' * 1234 # danger
31
+ GC.start
31
32
  end
32
33
 
33
34
  expect(result.length).to be >= 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allocation_tracer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada
@@ -75,6 +75,7 @@ extensions:
75
75
  extra_rdoc_files: []
76
76
  files:
77
77
  - ".gitignore"
78
+ - ".travis.yml"
78
79
  - Gemfile
79
80
  - LICENSE.txt
80
81
  - README.md