lib/memdump/memory_dump.rb
# Return the entries that refer to the entries in the dump
#
# @param [MemoryDump] the set of entries whose parents we're looking for
# @param [Integer] min only return the entries in self that refer to
#   more than this much entries in 'dump'
# @param [Boolean] exclude_dump exclude the entries that are already in
#   'dump'
# @return [(MemoryDump,Hash)] the parent entries, and a mapping from
#   records in the parent entries to the count of entries in 'dump' they
#   refer to
Return the entries that refer to the entries in the dump
Return the entries that refer to the entries in the dump
def parents_of(dump, min: 0, exclude_dump: false)
            children = dump.addresses.to_set
            counts = Hash.new
            filtered = find_all do |r|
                next if exclude_dump && children.include?(r['address'])
                count = r['references'].count { |r| children.include?(r) }
                if count > min
                    counts[r] = count
                    true
                end
            end
            return filtered, counts
        end
def parents_of ( dump , min : 0 , exclude_dump : false ) children = dump . addresses . to_set counts = Hash . new filtered = find_all do | r | next if exclude_dump && children . include? ( r [ 'address' ] ) count = r [ 'references' ] . count { | r | children . include? ( r ) } if count > min counts [ r ] = count true end end return filtered , counts end
Return the entries that refer to the entries in the dump
Return the entries that refer to the entries in the dump
the parent entries, and a mapping from records in the parent entries to the count of entries in 'dump' they refer to
the parent entries and a mapping from records in the parent entries to the count of entries in ' dump ' they refer to
(MemoryDump,Hash)
dump
min
exclude_dump
exclude_dump exclude the entries that are already in 'dump'
exclude_dump exclude the entries that are already in ' dump '