From: navee83@gmail.com (Naveen Kumar)
To: kernelnewbies@lists.kernelnewbies.org
Subject: What is the adventage of macros against function
Date: Wed, 27 Apr 2011 04:57:47 -0400 [thread overview]
Message-ID: <BANLkTinXk3s9XK=oTt2TwrSi2c0DAjyXAg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTingvD62dCuGLW-4rOrmzMd2uMPwfQ@mail.gmail.com>
Actually you will see lot of macros defined to achieve small and modular
functionality.
this makes your code faster to execute but the binary size will be bigger.
You will see this in kernel code more because we have very low stack area
sometime may be one page(4096 bytes) of memory.
automatic variable declare and defined in function will occupy space in
stack.
In application side C expert suggest to have functions because we have very
big stack area and function adds readability
with easy debugging.
I hope this will help you in your kernel context.
Thanks,
Naveen
2011/4/27 ?smail Baydan <ibaydan@gmail.com>
> Currently I am trying to learn linux kernel while looking around I saw that
> a lot of function likes macros are defined.What is the adventage of macros
> over functions.
> Thanks
>
> --
> ?smail Baydan
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110427/471ac82b/attachment.html
prev parent reply other threads:[~2011-04-27 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 8:25 What is the adventage of macros against function İsmail Baydan
2011-04-27 8:46 ` Ramya Desai
2011-04-27 9:09 ` İsmail Baydan
2011-04-27 12:25 ` Jonathan Neuschäfer
2011-04-27 14:12 ` Ozan Türkyılmaz
2011-04-27 8:57 ` Naveen Kumar [this message]
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='BANLkTinXk3s9XK=oTt2TwrSi2c0DAjyXAg@mail.gmail.com' \
--to=navee83@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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).