From: Dag Sverre Seljebotn Date: Thu, 27 Nov 2008 11:10:36 +0000 (+0100) Subject: Mark temp as not managed in buffer code (see previous commit notes) X-Git-Tag: 0.11-beta~202 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4ee0a2dfabb73903da716d374f2a853264b08470;p=cython.git Mark temp as not managed in buffer code (see previous commit notes) --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 78fd7779..eb780c82 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1224,7 +1224,10 @@ class NameNode(AtomicExprNode): rhs.generate_post_assignment_code(code) def generate_acquire_buffer(self, rhs, code): - rhstmp = code.funcstate.allocate_temp(self.entry.type) + # rhstmp is only used in case the rhs is a complicated expression leading to + # the object, to avoid repeating the same C expression for every reference + # to the rhs. It does NOT hold a reference. + rhstmp = code.funcstate.allocate_temp(self.entry.type, manage_ref=False) buffer_aux = self.entry.buffer_aux bufstruct = buffer_aux.buffer_info_var.cname code.putln('%s = %s;' % (rhstmp, rhs.result_as(self.ctype())))