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: [patch] Fix for excessive stack use (gdb/10457)


> 2009-10-07  Paul Pluzhnikov  <ppluzhnikov@google.com>
> 
>         * elfread.c (elf_symtab_read): Don't use alloca in a loop.

alloca was very convenient because it allows us to not worry about
memory leaks that could happen if record_minimal_symbol throws an error,
for instance. Thanks to Jan's excellent eyes, we know that
record_minimal_symbol eventually results in a call to XCALLOC, which
can possibly cause an internal_error(). It's very unlikely to happen.
So I wouldn't have complained if you had used a cleanup to make sure
that the memory is always released. But in this case, I don't see
record_minimal_symbol ever needing to thrown an exception on its own,
and I don't see that such a small leak can make a difference if we run
out of memory.

The patch is approved.

-- 
Joel


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