This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFA] c++/11734


On 06/22/2010 02:45 AM, Pedro Alves wrote:
It looks like `name' is invariant in
this loop, so you could for example, move the `new' declaration
out of the loop, initialized as NULL, and allocate it only once
on first need.

I completely missed that. [Forest/trees kind of thing, I guess.]


I noticed that I also missed adding this logic to the linear search case. I've attached a revised patch which addresses this missed bit and moves the alloca out of the loop.

Good catch!

Keith

PS. In case it isn't well-known: regression-free on x86_64 linux.

Attachment: pr11734-2.patch
Description: Text document


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