Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 1995 13:43:32 -0600
From:      Nate Williams <nate@rocky.sri.MT.net>
To:        "Garrett A. Wollman" <wollman@lcs.mit.edu>
Cc:        Terry Lambert <terry@lambert.org>, ache@astral.msk.su, Kai.Vorma@hut.fi, current@freebsd.org
Subject:   Re: tail dumps core
Message-ID:  <199510101943.NAA22092@rocky.sri.MT.net>
In-Reply-To: <9510101901.AA10410@halloran-eldar.lcs.mit.edu>
References:  <9510101735.AA10192@halloran-eldar.lcs.mit.edu> <199510101836.LAA10827@phaeton.artisoft.com> <9510101901.AA10410@halloran-eldar.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Garrett A. Wollman writes:
> <<On Tue, 10 Oct 1995 11:36:34 -0700 (MST), Terry Lambert <terry@lambert.org> said:
> 
[ Non-portability of bzero and calloc ]

{ Code deleted }

So, what's your point?  Other than some comments in this set of lines

> 	memset(&i, 0, sizeof i);
> 	if (i == 0) {
> 		printf("your machine is normal\n");
> 	} else {
> 		printf("your machine is really weird, but allowed by the"
> 		       " C standard\n");
> 	}

which implies that memset doesn't have to set an integer to all zeros,
what's the problem?  How does the C standard allow for memseting an int
to be non-zero?

Also, you made the assertion that calloc() is almost never necessary.  I
charge you to backup that statement, since I often use structures which
I must explicity zero out all of the members, and using calloc() and/or
 malloc/memset is a big performance win compared to zero'ing out every
single member of the struct.



Nate



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199510101943.NAA22092>