Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Is malloc() or calloc() "better"? Message-ID: <9299@smoke.BRL.MIL> Date: 7 Jan 89 01:07:11 GMT References: <46929@yale-celray.yale.UUCP> <403@laic.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 In article <403@laic.UUCP> darin@nova.UUCP (Darin Johnson) writes: -Actually, calloc() is not always a shell around malloc()! On an early -Pyramid, I had spent lots of wasted time tracking down a bug, that fixed -itself when I used free() for malloc()ed objects, and cfree() for -calloc()ed objects. In the buggy version, free() was used for -everything... The bug was in the Pyramid implementation of calloc()/cfree(). calloc()ed storage may legitimately be freed with free().