Module: LivingDead

Defined in:
lib/living_dead.rb,
lib/living_dead/version.rb

Defined Under Namespace

Classes: ObjectTrace

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.freed_objectsObject



63
64
65
66
67
68
# File 'lib/living_dead.rb', line 63

def self.freed_objects
  gc_start
  freed_hash.map do |key, _|
    tracing_hash[key]
  end
end

.trace(*args) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/living_dead.rb', line 10

def self.trace(*args)
  self.start
  trace = ObjectTrace.new(*args)

  self.tracing_hash[trace.key] = trace
  self.freed_hash[trace.key]   = false
end

.traced_objectsObject



18
19
20
21
22
23
# File 'lib/living_dead.rb', line 18

def self.traced_objects
  gc_start
  tracing_hash.map do |_, trace|
    trace
  end
end