This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: alloca() called when i do not want it to be called


Mike Stump <mrs@apple.com> writes:

>> 3. Is it true that if one declares a large array on stack,
>> gcc attempts to satisfy that memory requirement from the
>> .data section instead of the stack ?
>
> I don't think gcc normally does this.

This should never be done, as it produces nonreentrant code.  But a
feature where very large alloca() or VLAs produced code to call
malloc, and then free on scope exit, that would be interesting.
(It is somewhat nontrivial as I believe it is legitimate to call
alloca in a loop, and expect all the memory to get freed on function
exit.  VLAs do not have this problem.)

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]