OSDN Git Service

(__objc_xcalloc): Use calloc instead malloc/bzero.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 1994 23:13:10 +0000 (23:13 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Oct 1994 23:13:10 +0000 (23:13 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8357 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/objc/misc.c

index f5cae02..7ae9afa 100644 (file)
@@ -1,5 +1,5 @@
 /* GNU Objective C Runtime Miscellanious 
-   Copyright (C) 1993 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994 Free Software Foundation, Inc.
 
 Author: Kresten Krab Thorup
 
@@ -71,9 +71,8 @@ __objc_xrealloc(void* mem, size_t size)
 void*
 __objc_xcalloc(size_t nelem, size_t size)
 {
-  void* res = (void*)malloc(nelem * size);
+  void* res = (void*)calloc(nelem, size);
   if(!res)
     objc_fatal("Virtual memory exhausted\n");
-  bzero (res, nelem * size);
   return res;
 }