Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-04-29 11:00:49 +0300
committerJacques Lucke <mail@jlucke.com>2019-04-29 11:46:04 +0300
commitea940bcb539cc23cf01c230e295b6d3e05c50846 (patch)
treed347096d8ba1eb4fe4e75015ba7437c7d15279d6 /source/blender/blenlib/BLI_compiler_compat.h
parent383fef9f10481d1dd5b8bf92a33b8d0995b136d4 (diff)
New BLI_NOINLINE macro
This macro is handy in at least two occasions: * When you want to check the optimized generated assembly for some small function that would get inlined otherwise. * The marked function will be visible in profiling results. I can't test the implementations for other compilers now, so I did not include them. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D4754
Diffstat (limited to 'source/blender/blenlib/BLI_compiler_compat.h')
-rw-r--r--source/blender/blenlib/BLI_compiler_compat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_compiler_compat.h b/source/blender/blenlib/BLI_compiler_compat.h
index 80c564a70c7..bd1cd327d3c 100644
--- a/source/blender/blenlib/BLI_compiler_compat.h
+++ b/source/blender/blenlib/BLI_compiler_compat.h
@@ -45,4 +45,10 @@ template<typename T> static inline T decltype_helper(T x)
# define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__))
# endif
+# if defined(__GNUC__)
+# define BLI_NOINLINE __attribute__((noinline))
+# else
+# define BLI_NOINLINE
+# endif
+
#endif /* __BLI_COMPILER_COMPAT_H__ */