leak_profiler 0.7.2 → 0.7.4

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
  SHA256:
3
- metadata.gz: 4617e25a441cc0afc52ee22fd4e6cc809f0461b0ded79b7dfd691465a00ffb01
4
- data.tar.gz: 9c1fdcad31276d8995a3c21de17d6467177460c22971e65a9739aef0b549f54a
3
+ metadata.gz: 552cd32ae840bec7f18ff3b026c2d3a998a62d65084dc6ece997b0309ca90b26
4
+ data.tar.gz: bbdf650d238834a39daf03e7853774d3c1a33e6496d52973e4f054c10fa83fe1
5
5
  SHA512:
6
- metadata.gz: 22c3ffc40e9df1d8531b3833d90306979b8ea79a2574335ae38fcce4104d6574c85d46b54ac42725a67cccca51690972f029e947985d14a8e76a3efdcbdd4892
7
- data.tar.gz: 145340854bcfee96d1a94f86ed669f83bbe374f1bdf62d4bc78afc375a0600059024b7b339664ecaa9f9329e02cec0ef9325a1d8c3a9a302be92d6b7cdb9cbf0
6
+ metadata.gz: 88abc2cb127b1ed4ac525e9a0e8a97216a5ba579a124da48536381ba599ebd577810bb178318b325049413b46186b39787cee8ab621b3a08e6fde75a70e65982
7
+ data.tar.gz: 6799cd7a94df9e3bf3ab512a13372a44d778fba22cf83d41b1306529a6539c862ac603836725e4f3b3f0caf73ad1f77291cbd79190c6311d3185002ef11c6510
data/.rubocop.yml CHANGED
@@ -23,6 +23,9 @@ Style/ImplicitRuntimeError:
23
23
  Style/MissingElse:
24
24
  Enabled: false
25
25
 
26
+ Style/RescueModifier:
27
+ Enabled: false
28
+
26
29
  Style/StringLiterals:
27
30
  EnforcedStyle: single_quotes
28
31
 
@@ -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
- klass = obj_class(obj)
34
- allocations_by_class[klass] += ObjectSpace.memsize_of(obj)
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
@@ -101,7 +104,7 @@ class LeakProfiler
101
104
  ObjectSpace.each_object.each do |obj|
102
105
  r = ObjectSpace.reachable_objects_from(obj)
103
106
  begin
104
- if r&.include?(object)
107
+ if r&.any? { |o| o.equal?(object) }
105
108
  key = allocated_location(obj)
106
109
  next unless key
107
110
 
@@ -25,5 +25,7 @@ class LeakProfiler
25
25
  def allocated_location: (untyped obj) -> untyped
26
26
 
27
27
  def sort: (untyped allocations) -> untyped
28
+
29
+ def obj_class: (untyped obj) -> untyped
28
30
  end
29
31
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leak_profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watson
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2025-09-08 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: logger
@@ -57,6 +58,7 @@ metadata:
57
58
  homepage_uri: https://github.com/Watson1978/leak_profiler
58
59
  source_code_uri: https://github.com/Watson1978/leak_profiler
59
60
  rubygems_mfa_required: 'true'
61
+ post_install_message:
60
62
  rdoc_options: []
61
63
  require_paths:
62
64
  - lib
@@ -71,7 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
73
  - !ruby/object:Gem::Version
72
74
  version: '0'
73
75
  requirements: []
74
- rubygems_version: 3.6.9
76
+ rubygems_version: 3.5.22
77
+ signing_key:
75
78
  specification_version: 4
76
79
  summary: A simple profiler for Ruby to detect memory leak.
77
80
  test_files: []