Actually you will see lot of macros defined to achieve small and modular functionality.<br>this makes your code faster to execute but the binary size will be bigger.<br><br>You will see this in kernel code more because we have very low stack area sometime may be one page(4096 bytes) of memory.<br>
automatic variable declare and defined in function will occupy space in stack.<br><br>In application side C expert suggest to have functions because we have very big stack area and function adds readability <br>with easy debugging.<br>
<br>I hope this will help you in your kernel context.<br><br>Thanks,<br>Naveen<br><br><div class="gmail_quote">2011/4/27 Ęsmail Baydan <span dir="ltr">&lt;<a href="mailto:ibaydan@gmail.com">ibaydan@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">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.<br>
Thanks<br clear="all"><br>-- <br><font color="#888888">Ęsmail Baydan<br>
</font><br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br>