allocation_tracer 0.0.3 → 0.0.5
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 +4 -4
- data/.travis.yml +4 -0
- data/README.md +7 -0
- data/ext/allocation_tracer/allocation_tracer.c +5 -4
- data/lib/allocation_tracer/allocation_tracer.so +0 -0
- data/lib/allocation_tracer/version.rb +1 -1
- data/spec/allocation_tracer_spec.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7842f134236279f5daff085c04b6d213006d9c22
|
4
|
+
data.tar.gz: accc0258ea2a0f27859b9322fc9d244de413ff77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5278e203b466d03ad3ed9af0229bcd3d0961f8657ceb7635253b3fe37854b23b6cd2e91821fc30ccbc96641fba334f9f219a247cb5d87bdc86ec9490dc345f11
|
7
|
+
data.tar.gz: 274eb069e103b48d9e6a99fbfbc99c7b416d244263008560c853a05dbd4ce878e70b636bdf0b6315b1e5583b21fb2c0fbb298caffd4beacba01df3f7284ef2a3
|
data/.travis.yml
ADDED
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
|
+
[](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,
|
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
|
-
|
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,
|
448
|
+
move_to_freed_list(arg, info);
|
448
449
|
return ST_CONTINUE;
|
449
450
|
}
|
450
451
|
|
Binary file
|
@@ -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
|
-
|
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.
|
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
|