Is malloc() or calloc() "better"?

Liber nevin1 at ihlpb.ATT.COM
Fri Jan 6 11:06:08 AEST 1989


In article <46857 at yale-celray.yale.UUCP> wald-david at 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 at 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!"
/  (_</_\/ <__/ / <_	As far as I know, these are NOT the opinions of AT&T.



More information about the Comp.lang.c mailing list