This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Is there a way to tell gcc to allocate local variable on the heap not the default stack?
- From: Remus Clearwater <remus dot clearwater at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 29 May 2018 09:27:33 +0800
- Subject: Is there a way to tell gcc to allocate local variable on the heap not the default stack?
Hi, for some reason, I want to keep the stack frame usage of some functions
as smaller as possible, but rewrite them by hands is such a pain and very
stupid since they are using many and big local variables currently. And in
these functions they doesn't do anything like longjmp.
So, is there a option to tell gcc to allocate local variable on the heap
not the default stack (auto free them before return)?
Thanks a lot.