allocation_tracer 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5591d5370e3ce789b1f83038fb1a569d5d95df2f
4
- data.tar.gz: 02e0ce857929fb00a7a05b2a4624a1ade3a9c634
3
+ metadata.gz: 89fd66efaa24f2319186b9499095bad976c68bfe
4
+ data.tar.gz: dff3b6ab0c8ba0a3db0a1140285dcdd9e06c569c
5
5
  SHA512:
6
- metadata.gz: ea426ef389e777313fef152336f8c0fdee45710d192ec063ba9996edd2d3cff48a473593a19ee41b98312d70b78160a60edba741891f5ea1461ed9481ac03cd8
7
- data.tar.gz: 8134ddefac4fb01ca99e0d7442cf1626e4e4a18802f80e5e1ed0f5d0abd3791976c72e88b32d5a52ea8fe411d44bbf4676b623966738f6d79d3c2f58a2897091
6
+ metadata.gz: 07a014504c663e8ff614ebeec62c49c2dcfb1cf30be1c3009cfa9da0c2d1f7a44ca8789db5919f1aeb6b337719fe0a6f614756749ac8c5aec0c91a766bb33085
7
+ data.tar.gz: 96fcd0458afc5d052843b269693c9f1fbffaa2df341abca68b11fd8e28bab04464cb0202b85629c61d3f22ed93ade287c656f06c43ac6b3da8204553b89177fe
@@ -200,7 +200,7 @@ clear_traceobj_arg(void)
200
200
  st_clear(arg->object_table);
201
201
  st_foreach(arg->str_table, free_keys_i, 0);
202
202
  st_clear(arg->str_table);
203
- arg->freed_allocation_info = 0;
203
+ arg->freed_allocation_info = NULL;
204
204
  delete_lifetime_table(arg);
205
205
  }
206
206
 
@@ -331,10 +331,15 @@ aggregate_freed_info(void *data)
331
331
  }
332
332
 
333
333
  static void
334
- move_to_freed_list(struct traceobj_arg *arg, struct allocation_info *info)
334
+ move_to_freed_list(struct traceobj_arg *arg, VALUE obj, struct allocation_info *info)
335
335
  {
336
+ if (arg->freed_allocation_info == NULL) {
337
+ rb_postponed_job_register_one(0, aggregate_freed_info, arg);
338
+ }
339
+
336
340
  info->next = arg->freed_allocation_info;
337
341
  arg->freed_allocation_info = info;
342
+ st_delete(arg->object_table, (st_data_t *)&obj, (st_data_t *)&info);
338
343
  }
339
344
 
340
345
  static void
@@ -380,13 +385,11 @@ freeobj_i(VALUE tpval, void *data)
380
385
  struct allocation_info *info;
381
386
 
382
387
  if (st_lookup(arg->object_table, (st_data_t)obj, (st_data_t *)&info)) {
388
+
383
389
  info->flags = RBASIC(obj)->flags;
384
390
  info->memsize = rb_obj_memsize_of(obj);
385
- move_to_freed_list(arg, info);
386
- st_delete(arg->object_table, (st_data_t *)&obj, (st_data_t *)&info);
387
- if (arg->freed_allocation_info == NULL) {
388
- rb_postponed_job_register_one(0, aggregate_freed_info, arg);
389
- }
391
+
392
+ move_to_freed_list(arg, obj, info);
390
393
 
391
394
  if (arg->lifetime_table) {
392
395
  add_lifetime_table(arg->lifetime_table, BUILTIN_TYPE(obj), info);
@@ -1,3 +1,3 @@
1
1
  module ObjectSpace::AllocationTracer
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -23,5 +23,6 @@ module ObjectSpace::AllocationTracer
23
23
  ObjectSpace::AllocationTracer.stop
24
24
  result = ObjectSpace::AllocationTracer.lifetime_table
25
25
  ObjectSpace::AllocationTracer.lifetime_table_setup false
26
+ result
26
27
  end
27
28
  end
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada