This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] little cleanup in allocate_objfile
On Fri, Oct 23, 2009 at 6:23 AM, Tristan Gingold <gingold@adacore.com> wrote:
> Thanks, committed.
I've checked in the patch below under the obvious rule.
Thanks,
--
Paul Pluzhnikov
2009-10-23 Paul Pluzhnikov <ppluzhnikov@google.com>
* objfiles.c (allocate_objfile): Use xzalloc.
Index: objfiles.c
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.c,v
retrieving revision 1.101
diff -u -p -u -r1.101 objfiles.c
--- objfiles.c 23 Oct 2009 13:22:46 -0000 1.101
+++ objfiles.c 23 Oct 2009 14:31:27 -0000
@@ -196,8 +196,7 @@ allocate_objfile (bfd *abfd, int flags)
{
struct objfile *objfile;
- objfile = (struct objfile *) xmalloc (sizeof (struct objfile));
- memset (objfile, 0, sizeof (struct objfile));
+ objfile = (struct objfile *) xzalloc (sizeof (struct objfile));
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
/* We could use obstack_specify_allocation here instead, but