Hi,

Dag Sverre Seljebotn wrote:
> I must admit I need a little help here. At what point is it the new 
> temps differ from the old temps?

They differ in that there is not currently a dedicated flow for temp
allocation/deallocation between nodes at code generation time like there
was one at pre-allocation time for the old temps.


> another proposal:
> 
> Get rid of the idea of a "temporary expression node" altogether.

Yep, that doesn't lead anywhere.


> - Each node still flags whether it needs a result variable (i.e. the 
> is_temp of today, or rather needs_target as I'll call it from here on).

I never really understood what "is_temp" was supposed to mean, but
"needs_target" sounds clear enough.


> - Before the parent calls subexpr.generate_result_code, it has to check 
> subexpr.needs_target. If True, the parent must call 
> subexpr.set_target(some_cname)
>
> - If the parent doesn't have a variable handy to put the result in, it 
> needs to allocate a temp, hand it to the child for it to store its 
> result in, and finally release the temp when the result is no longer needed.

That sounds like part of this could be automated with a good default.

Sounds like a good proposal to me.

Stefan

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to