On Jan 14, 2013, at 19:14, Nicolas George wrote:
> 
> I checked both in the man page (from gcc+glibc) and a test program: if you
> use alloca() inside a loop, it returns a new block each time, while a
> compound literal has always the same address. The man page says:

Ok. Note however that a changing address doesn't mean that the previous block 
wasn't allocated.

> Except that there is no garbage collection when the memory runs out. I count
> a block of memory that is freed later than expected without way of catching
> it as a leak. Otherwise, there would be no leaks possible, all memory is
> freed when a process terminates.

True (though that wasn't always the case). 

Seems like this would speak for using a local std::string instance in C++ code 
where a compound literal cannot be used.

R.
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to