DragonFly BSD
DragonFly submit List (threaded) for 2004-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: style(9) sweep on config(8)


From: Robert Garrett <rg70@xxxxxxxxxxxxx>
Date: Thu, 04 Mar 2004 19:41:21 -0600

Robert Garrett wrote:
Joerg Sonnenberger wrote:

On Thu, Mar 04, 2004 at 07:04:04PM -0500, Dave Cuthbert wrote:

Chris Pressey wrote:

o Use memset(ptr, 0, size) instead of bzero(ptr, size)


Is there a reason why uses of bzero() should be changed to memset()?



For the kernel, using bzero is fine. For the userland bzero is BSD specific function, while memset is ISO C89.

For timing, they should ~identical.

Joerg


Dave

minus an extra call and return pair, memset is a special case of bzero,
memset is defined by ISO C89 but everybody else now seems has an implementation of bzero.


Rob
actually thats not correct on INTEL.. they are seperate instructions, I didn't bother to look in /usr/lib/libc/i386/strings

Robert Garrett



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]