From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [119.145.14.64]) by dpdk.org (Postfix) with ESMTP id CFA145A31 for ; Thu, 22 Jan 2015 04:39:25 +0100 (CET) Received: from 172.24.2.119 (EHLO szxeml428-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CIH42146; Thu, 22 Jan 2015 11:39:21 +0800 (CST) Received: from [127.0.0.1] (10.177.19.115) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.158.1; Thu, 22 Jan 2015 11:39:11 +0800 Message-ID: <54C070DF.1050006@huawei.com> Date: Thu, 22 Jan 2015 11:39:11 +0800 From: Linhaifeng User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: "dev@dpdk.org" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.19.115] X-CFilter-Loop: Reflected Subject: [dpdk-dev] some questions about rte_memcpy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2015 03:39:27 -0000 #define rte_memcpy(dst, src, n) \ ((__builtin_constant_p(n)) ? \ memcpy((dst), (src), (n)) : \ rte_memcpy_func((dst), (src), (n))) Why call memcpy when n is constant variable? Can i change them to the follow codes? #define rte_memcpy(dst, src, n) \ { \ int num = n; \ rte_memcpy_func((dst), (src), (num))) \ } -- Regards, Haifeng