1 Dec 2008 02:09
Re: [Cython] Temp allocation flow
Greg Ewing wrote:
> Dag Sverre Seljebotn wrote:
>> It
>> now takes two parameters, "decref" and "free_temp", which both defaults
>> to True, and which can be toggled.
>
> Rather than a free_temp parameter, I'd be more inclined
> to have an owns_temp flag on the node, set according to
> whether the node allocated the temp itself or it was
> supplied by the parent (currently done via an optional
> parameter to allocate_temps(), which would become a
> parameter to generate_evaluation_code()).
I didn't supply enough context. It was meant for situations like this:
self.arg.generate_evaluate_code(code)
...
code.putln("if (...) {")
...
self.arg.generate_disposal_code(code)
...
code.putln("} else {")
...
self.arg.generate_disposal_code(code)
...
code.putln("}")
Here, one can't free the temp in the first generate_disposal_code
(because then the else-block could reuse and overwrite the temp etc.).
As mentioned this is now solved by considering temp freeing as a
(Continue reading)
RSS Feed