From: Dag Sverre Seljebotn Date: Sun, 20 Jul 2008 12:37:04 +0000 (+0200) Subject: Buffer first assignment refcount optimization X-Git-Tag: 0.9.8.1~49^2~85 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=08fd7fb70fcce28082732c9504f509debff849cf;p=cython.git Buffer first assignment refcount optimization --- diff --git a/Cython/Compiler/Buffer.py b/Cython/Compiler/Buffer.py index 97bd6e00..4b1d630e 100644 --- a/Cython/Compiler/Buffer.py +++ b/Cython/Compiler/Buffer.py @@ -205,6 +205,13 @@ class BufferTransform(CythonTransform): u"ACQUIRE": StatListNode(node.pos, stats=acquire_stats), u"BUFINFO": NameNode(pos=node.pos, name=buffer_aux.buffer_info_var.name) }, pos=node.pos) + # Preserve first assignment info on LHS + if node.first: + # TODO: Prettier code + print acq.stats[4].dump() + acq.stats[4].first = True + del acq.stats[0] + del acq.stats[0] # Note: The below should probably be refactored into something # like fragment.substitute(..., context=self.context), with # TreeFragment getting context.pipeline_until_now() and