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]
Other format: [Raw text]

Re: Reduce alloca 'ted memory in dwarf2out.c


On Mon, Feb 14, 2005 at 12:49:35AM +0100, Christophe Jaillet wrote:
> Even if on the stack, why request more than needed ?

Simplicity.  One less source of potential off-by-one errors.  One less
place to crash for extremely large source files.  Et cetera.

> 
> 
> ----- Original Message -----
> From: "Daniel Jacobowitz" <drow@false.org>
> To: "Christophe Jaillet" <christophe.jaillet@wanadoo.fr>
> Cc: <gcc-patches@gcc.gnu.org>
> Sent: Monday, February 14, 2005 12:40 AM
> Subject: Re: Reduce alloca 'ted memory in dwarf2out.c
> 
> 
> > On Mon, Feb 14, 2005 at 12:36:15AM +0100, Christophe Jaillet wrote:
> > > Description : in gcc/dwarf2out.c, some memory allocated with alloca
> request
> > > too much. Just ask for what is needed
> > >
> > > Note : the first part of the patch assume that %x of
> comdat_symbol_number is
> > > less than 10 bytes
> > > The second part is always OK.
> >
> > What benefit does this have?  It's on the stack and not long-lived...
> >
> >
> > --
> > Daniel Jacobowitz
> > CodeSourcery, LLC
> >
> >
> 
> 
> 
> 

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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