lib/memdump/memory_dump.rb
def interface_with(dump)
            self_border = Hash.new
            dump_border = Hash.new
            each_record do |r|
                next if dump.find_by_address(r['address'])

                refs_in_dump = r['references'].map do |addr|
                    dump.find_by_address(addr)
                end.compact

                if !refs_in_dump.empty?
                    self_border[r['address']] = r
                    refs_in_dump.each do |child|
                        dump_border[child['address']] = child.dup
                    end
                end
            end

            self_border = MemoryDump.new(self_border)
            dump_border = MemoryDump.new(dump_border)

            dump.update_keepalive_count(dump_border)
            return self_border, dump_border
        end
# Compute the interface between self and the other dump, that is the
# elements of self that have a child in dump, and the elements of dump
# that have a parent in self
Compute the interface between self and the other dump, that is the
elements of self that have a child in dump, and the elements of dump
that have a parent in self
Compute the interface between self and the other dump that is the elements of self that have a child in dump and the elements of dump that have a parent in self
def interface_with(dump)
            self_border = Hash.new
            dump_border = Hash.new
            each_record do |r|
                next if dump.find_by_address(r['address'])
                refs_in_dump = r['references'].map do |addr|
                    dump.find_by_address(addr)
                end.compact
                if !refs_in_dump.empty?
                    self_border[r['address']] = r
                    refs_in_dump.each do |child|
                        dump_border[child['address']] = child.dup
                    end
                end
            end
            self_border = MemoryDump.new(self_border)
            dump_border = MemoryDump.new(dump_border)
            dump.update_keepalive_count(dump_border)
            return self_border, dump_border
        end
def interface_with ( dump ) self_border = Hash . new dump_border = Hash . new each_record do | r | next if dump . find_by_address ( r [ 'address' ] ) refs_in_dump = r [ 'references' ] . map do | addr | dump . find_by_address ( addr ) end . compact if ! refs_in_dump . empty? self_border [ r [ 'address' ] ] = r refs_in_dump . each do | child | dump_border [ child [ 'address' ] ] = child . dup end end end self_border = MemoryDump . new ( self_border ) dump_border = MemoryDump . new ( dump_border ) dump . update_keepalive_count ( dump_border ) return self_border , dump_border end
Compute the interface between self and the other dump, that is the
elements of self that have a child in dump, and the elements of dump
that have a parent in self
Compute the interface between self and the other dump that is the elements of self that have a child in dump and the elements of dump that have a parent in self
dump