From owner-freebsd-current Tue May 28 02:39:05 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA13358 for current-outgoing; Tue, 28 May 1996 02:39:05 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id CAA13353 for ; Tue, 28 May 1996 02:38:56 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id TAA10416; Tue, 28 May 1996 19:31:28 +1000 Date: Tue, 28 May 1996 19:31:28 +1000 From: Bruce Evans Message-Id: <199605280931.TAA10416@godzilla.zeta.org.au> To: current@freebsd.org, scrappy@ki.net Subject: Re: memset/memcopy vs bzero/bcopy Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Subject: memset/memcopy vs bzero/bcopy > which one is preferred? and does it matter? New application code should use memset. kernel code must use bzero. memset isn't available in the kernel. New application code should use memcpy for non-overlapping copies and memmove for possibly-overlapping. memcopy doesn't exist. kernel code should use bcopy except for small, aligned copies, especially for ones of a known size. memcpy is only used in the kernel to give gcc a chance to inline it. The inline code is slower for misaligned copies and may be slower for large copies. Bruce