DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] some questions about  rte_memcpy
@ 2015-01-22  3:39 Linhaifeng
  2015-01-22  4:45 ` Matthew Hall
  0 siblings, 1 reply; 9+ messages in thread
From: Linhaifeng @ 2015-01-22  3:39 UTC (permalink / raw)
  To: 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-23  2:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22  3:39 [dpdk-dev] some questions about rte_memcpy Linhaifeng
2015-01-22  4:45 ` Matthew Hall
2015-01-22  5:32   ` Linhaifeng
2015-01-22  7:35     ` Matthew Hall
2015-01-22 10:23       ` Tetsuya Mukawa
2015-01-22 11:34         ` Bruce Richardson
2015-01-22 12:53           ` Linhaifeng
2015-01-22 15:21             ` Bruce Richardson
2015-01-23  2:58               ` Linhaifeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).