FPC cannot do such optimizations at the moment, and afaik even with C ++ they are included in the "undefined" class. (since the state of the program because of this optimization ignores what the programmer says)
The solution to this problem is the question of determining which structures can be optimized and which not. It does not need the help of the API / OS as such, any object file associated with an external object with such a function (since then global optimization will not affect it)
Please note that the article does not specify the C ++ compiler, so I expect this to be a more general utility function when the compiler user gets into problems without hitting documents too hard or when it should work easily on several (windows-only!) compilers, without overcomplicating the assembly.
Choosing a non-inlinable API function may not be optimal in other cases, especially with small, constant sizes to zero, since it will not be built-in, so I will be careful with this function and make sure that there is a complex need
This can be important mainly when an external object can change the memory (DMA, memory mapping, etc.) of a program or erase passwords and other confidential information from a memory image, even if the program will never read it according to the compiler
source share