Re: inline functions vs. alloca()
- From: Måns Rullgård <mru@xxxxxxxxxxxxx>
- Date: Wed, 01 Mar 2006 08:42:31 +0000
phil-news-nospam@xxxxxxxx writes:
If a C compiler such as GCC compiles a function as inline to the code
that was calling it, and that function calls alloca() to allocate some
space for its brief internal use, does that allocated memory still take
up stack space beyond where the inlined code is? If that happens and
the inlined code is allocating large space and/or is "called" inside a
loop, it would seem the stack could quickly become exhausted. I would
hope the compiler will at least restore the stack pointer so at the end
it is the same as at the beginning.
You'll probably get the most accurate answer by trying it out. If the
compiler supports it, you're probably better off with variable sized
arrays.
--
Måns Rullgård
mru@xxxxxxxxxxxxx
.
- References:
- inline functions vs. alloca()
- From: phil-news-nospam
- inline functions vs. alloca()
- Prev by Date: Re: How to find whether a given directory exists in a path in a makefile
- Next by Date: IP_HDRINCL option is not supported with IPv6
- Previous by thread: inline functions vs. alloca()
- Next by thread: Re: Not a flame war, but perl vs m4
- Index(es):
Relevant Pages
|