Revision: 77842
http://sourceforge.net/p/brlcad/code/77842
Author: brlcad
Date: 2020-12-01 10:31:09 +0000 (Tue, 01 Dec 2020)
Log Message:
-----------
provide _BU_ATTR_FLATTEN so performance critical functions can be better guide
inlining.
Modified Paths:
--------------
brlcad/trunk/include/bu/defines.h
Modified: brlcad/trunk/include/bu/defines.h
===================================================================
--- brlcad/trunk/include/bu/defines.h 2020-12-01 09:22:57 UTC (rev 77841)
+++ brlcad/trunk/include/bu/defines.h 2020-12-01 10:31:09 UTC (rev 77842)
@@ -190,6 +190,18 @@
/**
+ * shorthand placed before a function _definition_ indicating to some
+ * compilers that it should inline most of the function calls within
+ * the function. this should be used sparingly on functions that are
+ * demonstrably hot, as indicated by a profiler.
+ */
+#ifdef HAVE_FLATTEN_ATTRIBUTE
+# define _BU_ATTR_FLATTEN __attribute__((flatten))
+#else
+# define _BU_ATTR_FLATTEN
+#endif
+
+/**
* This macro is used to take the 'C' function name, and convert it at
* compile time to the FORTRAN calling convention.
*
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits