<br><br><div class="gmail_quote">2011/4/27 Ramya Desai <span dir="ltr"><<a href="mailto:ramya.desai@gmail.com">ramya.desai@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/4/27 Ęsmail Baydan <<a href="mailto:ibaydan@gmail.com">ibaydan@gmail.com</a>>:<br>
<div class="im">> Currently I am trying to learn linux kernel while looking around I saw that<br>
> a lot of function likes macros are defined.What is the adventage of macros<br>
> over functions.<br>
</div>If the size of the function is very small, then the macro is better<br>
when compared to function. The macros are replaced at the time of<br>
preprocessing. However, if there is a function, then there may be<br>
overhead in calling the function. When there is a call, the return<br>
address needs to be stored on the stack. This makes some overhead. So,<br>
if the size of a fucction is big, then define it as function otherwise<br>
make it as a macro.<br>
<br>
I guess, this helps you a bit.<br>
<br>
Regards,<br>
Ramya.<br>
<br>
> Thanks<br>
><br>
> --<br>
> Ęsmail Baydan<br>
><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>
><br>
</blockquote></div><br>thanks<br clear="all"><br>-- <br>Ęsmail Baydan<br>