On Wed, Nov 18, 2015 at 3:28 PM, Eric Botcazou <ebotca...@adacore.com> wrote: >> Looks good to me. I also found the Arrays of Variable Length section >> in extend.texi which also refers to alloca as doing the same. We may >> want to add a note there that you should not mix both and that only >> VLAs (when not mixed with alloca) are freed at scope boundary. > > It's already there and in fact the current behavior is documented: > > There are other differences between these two methods. Space allocated > with `alloca' exists until the containing _function_ returns. The > space for a variable-length array is deallocated as soon as the array > name's scope ends. (If you use both variable-length arrays and > `alloca' in the same function, deallocation of a variable-length array > also deallocates anything more recently allocated with `alloca'.) > > so we need to amend the documentation if we go for the patch.
Ah. I think the patch is good and we should reflect this in the documentation. Richard. > -- > Eric Botcazou