diff options
author | Joel Brobecker <brobecker@gnat.com> | 2009-03-19 14:32:38 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2009-03-19 14:32:38 +0000 |
commit | 982807ce66548e8260b49fe5ce2f7474231368e9 (patch) | |
tree | e612469653ea0eccdda8bbfe8585c3351027661f /sim/common/sim-utils.c | |
parent | c31af87b2e65cd40a9fb26ae08306a8ff559302a (diff) | |
download | gdb-982807ce66548e8260b49fe5ce2f7474231368e9.zip gdb-982807ce66548e8260b49fe5ce2f7474231368e9.tar.gz gdb-982807ce66548e8260b49fe5ce2f7474231368e9.tar.bz2 |
From: J"orn Rennecke <joern.rennecke@arc.com> (tiny change)
Speed up simulator startup:
* sim-utils.c (zalloc): Use xcalloc.
Diffstat (limited to 'sim/common/sim-utils.c')
-rw-r--r-- | sim/common/sim-utils.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index 682d0d3..e5e7f76 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -52,15 +52,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ 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 |