From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linhaifeng Subject: some questions about rte_memcpy Date: Thu, 22 Jan 2015 11:39:11 +0800 Message-ID: <54C070DF.1050006@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: "dev-VfR2kkLFssw@public.gmane.org" Return-path: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" #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