[dpdk-dev] some questions about rte_memcpy

Linhaifeng haifeng.lin at huawei.com
Thu Jan 22 04:39:11 CET 2015


#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



More information about the dev mailing list