From: J"orn Rennecke <joern.rennecke@arc.com> (tiny change)
authorJoel Brobecker <brobecker@gnat.com>
Thu, 19 Mar 2009 14:32:38 +0000 (14:32 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 19 Mar 2009 14:32:38 +0000 (14:32 +0000)
        Speed up simulator startup:
        * sim-utils.c (zalloc): Use xcalloc.

sim/common/ChangeLog
sim/common/sim-utils.c

index 91ba924147dc92c372bbf1037acbe04091a98cab..bf9c37527e5458b8b5c023b4af1400591f9173b7 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-19  J"orn Rennecke  <joern.rennecke@arc.com>  (tiny change)
+
+       Speed up simulator startup:
+       * sim-utils.c (zalloc): Use xcalloc.
+
 2009-01-07  Hans-Peter Nilsson  <hp@axis.com>
 
        * cgen-ops.h (ADDQI, SUBQI, MULQI, NEGQI, ABSQI, ADDHI, SUBHI)
index 682d0d3be03471664c5f246f35e181c2c0b8156a..e5e7f760dc3243809a6ce50081abf50fa1286010 100644 (file)
@@ -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
This page took 0.029143 seconds and 4 git commands to generate.