[cfe-users] Is there a way to tell clang to allocate local variables on the heap not the default stack?

Remus Clearwater via cfe-users cfe-users at lists.llvm.org
Tue May 29 17:55:13 PDT 2018


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 clang to allocate local variables on the heap
not the default stack (auto free them before return)?

PS:
Since I want to migrate many synchronous codes (currently) into
asynchronous implementation by hooking the blocking syscalls for
concurrency and performance by using C coroutine (copy stack). The
split-stack is fine but it is not mature (from aspects of performance and
customizability). And the standalone stack for each coroutine would also
cost too much.

Thanks a lot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20180530/409f1438/attachment.html>


More information about the cfe-users mailing list