Ticket #2129 (new enhancement)
Optimization: Helping gcc with function attributes
| Reported by: | tqh | Owned by: | axeld |
|---|---|---|---|
| Priority: | normal | Milestone: | R1 |
| Component: | System/Kernel | Version: | R1 development |
| Cc: | anevilyak | Blocked By: | |
| Platform: | x86 | Blocking: |
Description
I wanted to experiment with gcc's attribute((fastcall)) which makes the functions two first arguments being passed in registers. I added it to kernel functions I thought would be called a lot. The resulting OS seems to be very responsive, although no measurements have been done.
My patch is just for inspiration, it is ugly and I did not really care about compability or if I break any API. Providing it here for those interested. It is used A LOT in Mozilla sources btw although hidden behind macros. It might be useful along with other function attributes in critical parts.
Function attributes are described here: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
