This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH to replace alloca with xmalloc
- To: mark at codesourcery dot com
- Subject: Re: PATCH to replace alloca with xmalloc
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 01 Nov 1999 19:01:14 -0700
- cc: gcc-patches at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <199911012250.PAA16709228@n02.acl.lanl.gov>you write:
>
> While looking at memory usage issues, I went barking up the wrong tree
> for a while thinking that alloca was burning us. It turns out that we
> don't usually alloca *that* much memory. On the other hand, we really
> shouldn't be using alloca for lots of reasons:
IMHO, allocas based on register #s, insn #s, bb#s or other values which can
be potentially large need to be converted.
I do not think we need to blindly convert every alloca. There are some cases
where the semantics of alloca are perfect and we're allocating a small hunk
of memory with a short lifetime.
My point is not to convert everything blindly, but look critically at each one
and ask "can this alloca call allocate large hunks of memory" (for some
definition of large).
jeff