From: Joel Brobecker Date: Thu, 19 Mar 2009 14:32:38 +0000 (+0000) Subject: From: J"orn Rennecke (tiny change) X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=00c72a380f005f60d894849f75a100aef41a64c5;p=pf3gnuchains%2Fpf3gnuchains3x.git From: J"orn Rennecke (tiny change) Speed up simulator startup: * sim-utils.c (zalloc): Use xcalloc. --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 91ba924147..bf9c37527e 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2009-03-19 J"orn Rennecke (tiny change) + + Speed up simulator startup: + * sim-utils.c (zalloc): Use xcalloc. + 2009-01-07 Hans-Peter Nilsson * cgen-ops.h (ADDQI, SUBQI, MULQI, NEGQI, ABSQI, ADDHI, SUBHI) diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index 682d0d3be0..e5e7f760dc 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -52,15 +52,13 @@ along with this program. If not, see . */ Set by sim_resume. */ struct sim_state *current_state; -/* Allocate zero filled memory with xmalloc - xmalloc aborts of the +/* Allocate zero filled memory with xcalloc - xcalloc aborts if the allocation fails. */ void * zalloc (unsigned long size) { - void *memory = (void *) xmalloc (size); - memset (memory, 0, size); - return memory; + return xcalloc (1, size); } void