This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFC: Implement and use VEC(T,stack)
Alexandre Oliva <aoliva@redhat.com> writes:
> I wonder if it would make sense to introduce an attribute with a cleanup
> that could be used to verify or even automate (GCC-only) the release of
> the vector in case it gets reallocated. Considering that it is supposed
> to most often not be reallocated into the heap, this would probably work
> well even in stage1, when the attribute may be unavailable. This would
> help catch (at run time) mistakes such as returning the alloca()ed
> array.
We do already have the cleanup attribute for types. I'm agnostic as
to whether we want to start using it in the gcc sources.
Ian