|
From: | Rik |
Subject: | Re: symtab.h: why so many function bodies |
Date: | Wed, 24 Feb 2016 09:24:13 -0800 |
On 02/24/2016 06:29 AM,
address@hidden wrote:
In general this is correct. Inlining is usually restricted to the translation unit of the compiler (roughly one file of code after the pre-processor has run and all #include and #ifdef directives have been processed). However, there are compiler/linkers that can inline functions across multiple translation units (Link-Time Optimization). GCC is one of them with the -flto flag. See this discussion on Stack Overflow: http://stackoverflow.com/questions/5987020/can-the-linker-inline-functions.
In the same vein, I think it would be good to start using visibility attributes in Octave. The system is already largely in place with the decoration OCTAVE_API at the front of functions which are to have external linkage (visible to others). However, we only invoke the system on Windows platforms. My guess is that the the linker symbol table is crowded with a bunch of functions that are never called outside of a single translation unit (static file scope). This increases the sizes of the object files and probably makes the linker work a bit harder to read, but never use, these definitions. --Rik |
[Prev in Thread] | Current Thread | [Next in Thread] |