MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / finalize_memory

Method finalize_memory

Compiler/program.py:644–665  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

642 self.public_input_file.close()
643
644 def finalize_memory(self):
645 self.curr_tape.start_new_basicblock(None, "memory-usage",
646 req_node=self.curr_tape.req_tree)
647 # reset register counter to 0
648 if not self.options.noreallocate:
649 self.curr_tape.init_registers()
650 for mem_type, size in sorted(self.allocated_mem.items()):
651 if size and (not self.options.garbled or \
652 mem_type not in ('s', 'sg', 'c', 'cg')):
653 # print "Memory of type '%s' of size %d" % (mem_type, size)
654 if mem_type in self.types:
655 self.types[mem_type].load_mem(size - 1, mem_type)
656 else:
657 from Compiler.types import _get_type
658
659 _get_type(mem_type).load_mem(size - 1, mem_type)
660 if self.verbose:
661 if self.saved:
662 print("Saved %s memory units through reallocation" % self.saved)
663 print("Freed memory:", ", ".join(
664 "%s: %d" % (x, y.free_size())
665 for x, y in self.free_mem_blocks.items()))
666
667 def public_input(self, x):
668 """Append a value to the public input file."""

Callers 1

finalizeMethod · 0.95

Calls 7

_get_typeFunction · 0.90
printFunction · 0.85
start_new_basicblockMethod · 0.80
init_registersMethod · 0.80
free_sizeMethod · 0.80
load_memMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected