Re: What is the adventage of macros against function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
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@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux