dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Linhaifeng <haifeng.lin-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: some questions about  rte_memcpy
Date: Thu, 22 Jan 2015 11:39:11 +0800	[thread overview]
Message-ID: <54C070DF.1050006@huawei.com> (raw)

#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

             reply	other threads:[~2015-01-22  3:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22  3:39 Linhaifeng [this message]
     [not found] ` <54C070DF.1050006-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-01-22  4:45   ` some questions about rte_memcpy Matthew Hall
     [not found]     ` <20150122044531.GA13230-Hv3ogNYU3JfZZajBQzqCxQ@public.gmane.org>
2015-01-22  5:32       ` Linhaifeng
     [not found]         ` <54C08B54.50700-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-01-22  7:35           ` Matthew Hall
     [not found]             ` <20150122073526.GA14800-Hv3ogNYU3JfZZajBQzqCxQ@public.gmane.org>
2015-01-22 10:23               ` Tetsuya Mukawa
     [not found]                 ` <54C0CFB5.909-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>
2015-01-22 11:34                   ` Bruce Richardson
2015-01-22 12:53                     ` Linhaifeng
     [not found]                       ` <54C0F2B9.7050006-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2015-01-22 15:21                         ` Bruce Richardson
2015-01-23  2:58                           ` Linhaifeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C070DF.1050006@huawei.com \
    --to=haifeng.lin-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).