More on C++ stack arrays

Lionello Lunesu lionello at lunesu.remove.com
Thu Oct 24 05:07:13 PDT 2013


On 10/23/13, 23:30, John Colvin wrote:
> On Tuesday, 22 October 2013 at 21:05:33 UTC, Lionello Lunesu wrote:
>> Careful! Alloca doesn't get cleaned up when used in loops!
>
> scope(exit) works in a loop, so you can automatically clean it up like
> that.
>
> Destructors are also called on each iteration so RAII is an option.

You can't clean up alloca'ed memory, AFAIK.


More information about the Digitalmars-d mailing list