/rev/75fbb52aea09
changeset: 1327:75fbb52aea09
user: Marcel Keller <[email protected]>
date: Fri Oct 23 14:56:38 2009 +0200
summary: runtime: Preprocess decorator indicates whether item is from pool.
diffstat:
viff/active.py | 2 +-
viff/runtime.py | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diffs (42 lines):
diff -r f933bd327750 -r 75fbb52aea09 viff/active.py
--- a/viff/active.py Fri Oct 23 13:50:19 2009 +0200
+++ b/viff/active.py Fri Oct 23 14:56:38 2009 +0200
@@ -487,7 +487,7 @@
# At this point both share_x and share_y must be Share
# objects. We multiply them via a multiplication triple.
- a, b, c = self.get_triple(share_x.field)
+ (a, b, c), _ = self.get_triple(share_x.field)
d = self.open(share_x - a)
e = self.open(share_y - b)
diff -r f933bd327750 -r 75fbb52aea09 viff/runtime.py
--- a/viff/runtime.py Fri Oct 23 13:50:19 2009 +0200
+++ b/viff/runtime.py Fri Oct 23 14:56:38 2009 +0200
@@ -465,7 +465,8 @@
The decorated method will be replaced with a proxy method which
first tries to get the data needed from
:attr:`Runtime._pool`, and if that fails it falls back to the
- original method.
+ original method. It also returns a flag to indicate whether the
+ data is from the pool.
The *generator* method is only used to record where the data
should be generated from, the method is not actually called. This
@@ -480,14 +481,14 @@
self.increment_pc()
pc = tuple(self.program_counter)
try:
- return self._pool.pop(pc)
+ return self._pool.pop(pc), True
except KeyError:
key = (generator, args)
pcs = self._needed_data.setdefault(key, [])
pcs.append(pc)
self.fork_pc()
try:
- return method(self, *args, **kwargs)
+ return method(self, *args, **kwargs), False
finally:
self.unfork_pc()
_______________________________________________
viff-commits mailing list
[email protected]
http://lists.viff.dk/listinfo.cgi/viff-commits-viff.dk