Path: utzoo!utgpu!jarvis.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!geac!sq!msb From: msb@sq.sq.com (Mark Brader) Newsgroups: comp.lang.c Subject: Re: FREE Message-ID: <1990Mar3.043454.16771@sq.sq.com> Date: 3 Mar 90 04:34:54 GMT References: <2714@stl.stc.co.uk> <1990Feb27.155133.20341@druid.uucp> <16055@haddock.ima.isc.com> <1990Mar1.140829.17199@druid.uucp> <1990Mar2.152601.8000@cubmol.bio.columbia.edu> Reply-To: msb@sq.com (Mark Brader) Organization: SoftQuad Inc., Toronto Lines: 15 > Why is NOT malloc() made to initialize the contents automatically? > Is the efficiency a matter here? Yes, it is. For many applications there is no point in initializing it because the next thing you're going to do is overwrite the entire space anyway. In addition, malloc() does not know what type of data you're going to put in the allocated space, and so it couldn't tell what initial value to put there anyway. (calloc() puts all zero bits, which is only useful for integer types.) -- Mark Brader, SoftQuad Inc., Toronto "Remember the Golgafrinchans" utzoo!sq!msb, msb@sq.com -- Pete Granger This article is in the public domain.