From patchwork Mon Jan 12 15:14:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco X-Patchwork-Id: 427776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 414171401DA for ; Tue, 13 Jan 2015 02:14:25 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=cEJ WEHxXCGJMRe0vY0rXxw/YeMfTUCNXRfb0L55cKXSIJFyLgH36JcbnXYzcHVYSc1q S3A4P9lfEA9OAgLQzNYTZuZSJoYoxdwGAC1PxfnQSd1cX8bSBMVyalUk4MM8mtKF aNOfm0eY3mKEMleY2RKMNbEG3FldTbcprF4PbVUU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=E6aoc/Xfw S68HqKZ0U5/2KyEPTc=; b=beupJP1Ge+YW522ZGrl8E1GdIikFEMEMj9MaN2VPI IOR81BrOKfOuf5rGPemZFJuXVjgeYa4RhgP5NtIyA4RmefS2ZnjYwdWaEskvPWJI xHto0VFxSV55AhVYoyad70r9tCM1fsJVlnpA/mN1DgId2U9pjbqGSk1XX+vyu/EA B8= Received: (qmail 26653 invoked by alias); 12 Jan 2015 15:14:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 26643 invoked by uid 89); 12 Jan 2015 15:14:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com From: "Wilco Dijkstra" To: Subject: [PATCH] Improve bcopy performance Date: Mon, 12 Jan 2015 15:14:10 -0000 Message-ID: <001d01d02e7a$6aeeff40$40ccfdc0$@com> MIME-Version: 1.0 X-MC-Unique: 115011215141304001 Rather than using a C implementation of memmove, directly call memmove, which typically has a much faster optimized implementation. ChangeLog: 2015-01-12 Wilco Dijkstra wdijkstr@arm.com * string/bcopy.c (bcopy): Call memmove for performance. --- string/bcopy.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/string/bcopy.c b/string/bcopy.c index f497b5d..b26f347 100644 --- a/string/bcopy.c +++ b/string/bcopy.c @@ -15,14 +15,11 @@ License along with the GNU C Library; if not, see . */ +#include #include -#define memmove bcopy -#define rettype void -#define RETURN(s) return -#define a1 src -#define a1const const -#define a2 dest -#define a2const - -#include +void +bcopy (const void *src, void *dest, size_t len) +{ + memmove (dest, src, len); +}