Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter passing to Linux C inline functions

When calling a non-inline function with two integer or pointer parameters from a C program, they are passed in registers rdi and rsi. Can the compilation be done in such a way that integer/pointer parameters to inline functions are passed in registers as well (and not on the stack)?

like image 562
Friedrich Laher Avatar asked Sep 23 '26 19:09

Friedrich Laher


1 Answers

When a function is inlined, it is treated as if its code was written into the function that called it. When this happens, it is not passed parameters at all.

When a function isn't inlined, it's absolutely no different from a normal function. inline is just a hint to the compiler to try and inline a function; it doesn't affect linkage at all.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!