When you call a function, the compiler will create a stack frame for the new function call and it will
push items onto the stack here.
So the data itself that the data put on the stack depends on your compiler, the whether the code is
compiled for the debug or the release build here.
However, in general the will there will be information about the parameters passed here, the information
pass parameters and to the function, the return address here and the address the named the function
call here and the automatic variables are located in this function here.
This means that when you make a function call at runtime there will be a memory overhead and performance
overhead from creating this stack frame before the function runs and the performance overhead in when
you clean this function up.
So after the function completes here.
So if a function is inline, this overhead does not occur because the function call will use the current
stack frame rather than a new one.
So clearly the inline function should be small, both in terms of code and the memory used on the stack
here.
So the compiler can ignore the inline specified and call the function with a separate stack frame.
So we can actually specify the Cal conventions in this C++ here.
So when your code uses your own functions, you do not need to pay any attention to calling conventions
because the compiler will make sure that the appropriate convention is used.
So however, if you are writing library code that can be used by other C++ compilers or even by other
languages, the Colin Convention becomes important.
So science discourse is not about interoperable code.
We won't go into much step here, but instead we will look at two aspects function naming and stack
maintenance.
So we can also use the Sea Lancashire.
So when you give a C++ function a name, this is the name that you will use to call the function in
your C++ code.
However, under the covers, the C++ compiler will decorate the name with the extra symbols for the
return type and the parameter so that the overloaded functions all have different names.
So to the C++ developers, it is also known as the name Mangling Mangling.
So if you need to export a function through the shared library, for example, in Windows Dynamic Linked
Library, this means that the files for the.
Shared library library in windows here that the WL files here so this means dynamic linked library so
you must use the types and names that the other languages can use.
So to do this you can mark a function with the x ten c here.
This means that the function has C linkage and the compiler will not use the external code and you should
not use it with the function to have a return values and parameters that use the C plus plus custom
steps.
External C here.
Like that.
So.
However, if such function does return a C++ type, the compiler will only use a warning.
The reason is that the C is a flexible language and the C programmer will be able to work out how to
turn the C++ type into something usable.
But it's poor practice to abuse them like this here.