Path: utzoo!attcan!uunet!lll-winken!lll-ncis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!rutgers!att!ihlpb!nevin1 From: nevin1@ihlpb.ATT.COM (Liber) Newsgroups: comp.lang.c Subject: Re: Is malloc() or calloc() "better"? Message-ID: <9339@ihlpb.ATT.COM> Date: 6 Jan 89 01:06:08 GMT References: <9254@smoke.BRL.MIL> <46857@yale-celray.yale.UUCP> Reply-To: nevin1@ihlpb.UUCP (55528-Liber,N.J.) Organization: AT&T Bell Laboratories - Naperville, Illinois Lines: 15 In article <46857@yale-celray.yale.UUCP> wald-david@CS.YALE.EDU (david wald) writes: |There is one possibility of a situation where calloc could be more |useful than malloc, however. In some virtual memory systems it is |possible to allocate memory filled with a zero bit pattern without |actually paging through the memory range. In this case, wouldn't malloc() just call the same routine as calloc()? Since calloc() always has to do more work than malloc(), malloc() should always get the best performance. -- _ __ NEVIN ":-)" LIBER nevin1@ihlpb.ATT.COM (312) 979-4751 IH 4F-410 ' ) ) "I will not be pushed, filed, stamped, indexed, / / _ , __o ____ briefed, debriefed or numbered! My life is my own!" / (_