Class: Async::RSpec::Memory::Allocation
- Inherits:
-
Struct
- Object
- Struct
- Async::RSpec::Memory::Allocation
- Defined in:
- lib/async/rspec/memory/trace.rb
Constant Summary collapse
- SLOT_SIZE =
40
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#size ⇒ Object
Returns the value of attribute size.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count
26 27 28 |
# File 'lib/async/rspec/memory/trace.rb', line 26 def count @count end |
#size ⇒ Object
Returns the value of attribute size
26 27 28 |
# File 'lib/async/rspec/memory/trace.rb', line 26 def size @size end |
Class Method Details
.default_hash ⇒ Object
36 37 38 |
# File 'lib/async/rspec/memory/trace.rb', line 36 def self.default_hash Hash.new{|h,k| h[k] = Allocation.new(0, 0)} end |
Instance Method Details
#<<(object) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/async/rspec/memory/trace.rb', line 29 def << object self.count += 1 # We don't want to force specs to take the slot size into account. self.size += ObjectSpace.memsize_of(object) - SLOT_SIZE end |