Dominik Vogt <fvwm_at_fvwm.org> writes:
> On Thu, Mar 21, 2002 at 11:31:46PM -0600, Dave Trollope wrote:
...
> > I have half a dozen of these kind of things and a place or two where
> > memset is called prior to a memcpy that overwrites the same block memset
> > cleared.
>
> Do you have a list of these? Some of the memset() calls are
> redundant. Not all of these are bad thoug. Some are merely
> intended to prevent uninitialised elements of structures if new
> members are added to the structures in the future.
I seem to remember at least one unnecessary memset added to avoid a
Purify message about a UMR (unitialized memory read).
> - In many places there is code like
> ptr = safemalloc(size);
> memset(ptr, 0, size);
> This could be done faster and smaller with safecalloc().
I know of at least one platform (C/370 MVS) where malloc/memset is
faster than calloc. I don't know why, but I believe memset is
normally done inline on that platform.
This information was from a few years ago.
--
Dan Espen E-mail: dane_at_mk.telcordia.com
444 Hoes Lane Room RRC 1C-214 Phone: (732) 699-5570
Piscataway, NJ 08854
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri Mar 22 2002 - 12:43:24 GMT