Ignore:
Timestamp:
Apr 16, 2008, 12:11:38 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • Add mode 8, for the very first graphic in the paper.
  • Add results for mode 8 in part0/lena-values.txt.
  • Make the bytecode version use less memory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • research/2008-displacement/main-cpushare

    r2287 r2288  
    1717    print 'Usage: %s <buy_order.cpu> -<mode> [image list]' % (sys.argv[0],)
    1818    sys.exit(-1)
    19 mode = sys.argv[2][1]
     19mode = sys.argv[2]
    2020done = 0
    2121source = sys.argv[3:]
     
    3434
    3535    def start(self):
    36         global todo, source
     36        global mode, todo, source
     37        gd.gdMaxColors = 256 * 256 * 256
     38        while todo < len(source):
     39            try:
     40                self.index = todo
     41                im = gd.image(source[self.index])
     42                break
     43            except:
     44                todo += 1
     45                self.result = "Error\n"
    3746        if todo >= len(source):
    38             return # We're finished... FIXME: is the transaction kept stuck?
    39         self.index = todo
     47            return # We're finished... FIXME: isn't the transaction stuck?
    4048        todo += 1
    41         gd.gdMaxColors = 256 * 256 * 256
    42         im = gd.image(source[self.index])
    4349        # Send argument count
    4450        self.protocol.sendString(PROTO_SECCOMP_FORWARD + chr(3))
     
    4652        msg = chr(3)
    4753        msg += "bytecode\0"
    48         msg += "-1\0"
     54        msg += mode + "\0"
    4955        msg += source[self.index] + "\0"
    5056        self.protocol.sendString(PROTO_SECCOMP_FORWARD + msg)
Note: See TracChangeset for help on using the changeset viewer.