This is the mail archive of the gcc-patches@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]

Re: PATCH to replace alloca with xmalloc


  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




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