mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-10 05:57:57 -05:00
Fix complexity bug in allocation.
This commit is contained in:
@@ -101,6 +101,7 @@ class StraightlineAllocator:
|
||||
self.dealloc |= reg.vector
|
||||
else:
|
||||
self.dealloc.add(reg)
|
||||
reg.duplicates.remove(reg)
|
||||
base = reg.vectorbase
|
||||
|
||||
seen = set_by_id()
|
||||
@@ -171,7 +172,7 @@ class StraightlineAllocator:
|
||||
for reg in self.alloc:
|
||||
for x in reg.get_all():
|
||||
if x not in self.dealloc and reg not in self.dealloc \
|
||||
and len(x.duplicates) == 1:
|
||||
and len(x.duplicates) == 0:
|
||||
print('Warning: read before write at register', x)
|
||||
print('\tregister trace: %s' % format_trace(x.caller,
|
||||
'\t\t'))
|
||||
|
||||
@@ -265,6 +265,9 @@ class set_by_id(object):
|
||||
def pop(self):
|
||||
return self.content.popitem()[1]
|
||||
|
||||
def remove(self, value):
|
||||
del self.content[id(value)]
|
||||
|
||||
def __ior__(self, values):
|
||||
for value in values:
|
||||
self.add(value)
|
||||
|
||||
Reference in New Issue
Block a user