[Cython] Bug, or changed array assignment in 0.17beta1?

Stefan Behnel stefan_ml at behnel.de
Wed Jul 25 12:28:43 CEST 2012


mark florisson, 25.07.2012 12:18:
> I'm wondering, what was the original motivation to reuse temporaries?

Shorter C code. Then, at some point, also smaller closures.


> I think it leads to more problems than benefits in most cases, all you
> really care about is clearing up references.

It's usually fine for C types, though. Except for the very specific case of
stack allocated C array literals, for which an explicitly allocated
(invisible) local variable would have been a better idea, I think.


> Do we ever have C++ stack-allocated object temporaries?

Don't think so. They'd be pointers.


> Or does it save some stack space
> (always, or when you take a pointer to the temporary)?

C compilers do variable aliasing anyway, so I don't think this matters.

Stefan



More information about the cython-devel mailing list