class ObjectSpace::AllocationSampler::Result::Frame

Attributes

children[R]
line[R]
samples[RW]
total_samples[RW]

Public Class Methods

new(frame, line, samples) click to toggle source
Calls superclass method
# File lib/allocation_sampler.rb, line 27
def initialize frame, line, samples
  super(frame)
  @line = line
  @samples = samples
  @total_samples = 0
  @children = Set.new
end

Public Instance Methods

each() { |node| ... } click to toggle source
# File lib/allocation_sampler.rb, line 35
def each
  seen = {}
  stack = [self]

  while node = stack.pop
    next if seen[node]
    seen[node] = true
    yield node
    stack.concat node.children.to_a
  end
end
to_dot() click to toggle source
# File lib/allocation_sampler.rb, line 47
def to_dot
  seen = {}
  "digraph allocations {\n" +
    "  node[shape=record];\n" + print_edges(self, seen, total_samples) + "}\n"
end

Private Instance Methods

print_edges(node, seen, total_samples) click to toggle source