leak_profiler 0.7.3 → 0.7.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/.rubocop.yml +3 -0
- data/ext/leak_profiler/leak_profiler.c +1 -1
- data/lib/leak_profiler/allocations.rb +5 -2
- data/sig/generated/leak_profiler/allocations.rbs +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b9ed880d59ba3afb26bc0c8842545114d800d2e4466bde187118c70ea489ca4
|
4
|
+
data.tar.gz: 9ac75655078d74b67928439f0ffb0493635075fee3226ebb4c37de6236bebd33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e2ca40923c1f4baa23266d4f84b811af144e7f5c9feacdc054df13817066bd8c608ba55b99f5f9f50e471d17ce00938a3646e02962ba776b9b02e81ad86c594
|
7
|
+
data.tar.gz: b8290c21265e17360816dd9f332f976a695c53d590b12aaeeb48324516ace274a88c47fc8bd43dff2d91686b263563de5472941183fcfd82aa0ae7c12456c491
|
data/.rubocop.yml
CHANGED
@@ -13,7 +13,7 @@ static VALUE leak_profiler_rss(VALUE self)
|
|
13
13
|
if (!GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) {
|
14
14
|
rb_sys_fail("GetProcessMemoryInfo");
|
15
15
|
}
|
16
|
-
return LONG2NUM(pmc.
|
16
|
+
return LONG2NUM(pmc.WorkingSetSize / 1024);
|
17
17
|
}
|
18
18
|
|
19
19
|
#elif defined(__APPLE__)
|
@@ -30,8 +30,11 @@ class LeakProfiler
|
|
30
30
|
allocations_by_class = Hash.new { |h, k| h[k] = 0 }
|
31
31
|
|
32
32
|
ObjectSpace.each_object.each do |obj|
|
33
|
-
|
34
|
-
|
33
|
+
begin
|
34
|
+
klass = obj_class(obj)
|
35
|
+
allocations_by_class[klass] += ObjectSpace.memsize_of(obj)
|
36
|
+
rescue StandardError
|
37
|
+
end
|
35
38
|
|
36
39
|
key = allocated_location(obj)
|
37
40
|
next unless key
|