summaryrefslogtreecommitdiff
path: root/src/base/macros.h
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2013-02-05 18:29:08 -0800
committer Ian Rogers <irogers@google.com> 2013-02-05 18:29:08 -0800
commit1ffa32f0be7becec4907b26ead353e4b17e1219c (patch)
tree4b023e55080f75a4945a44588d12bfbb3aec8bd3 /src/base/macros.h
parentc0fa3ad44a84b7f658d16a717027bf95abc85db6 (diff)
Reduce inlining in debug builds.
Fixes 018-stack-overflow on the host with interpreter. Change-Id: Ieed091b341b7812cfe898421a74d2f41f6a6a8bc
Diffstat (limited to 'src/base/macros.h')
-rw-r--r--src/base/macros.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/base/macros.h b/src/base/macros.h
index 52013dacc2..48cb9c013a 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -130,6 +130,12 @@ char (&ArraySizeHelper(T (&array)[N]))[N];
#define LIKELY(x) __builtin_expect((x), true)
#define UNLIKELY(x) __builtin_expect((x), false)
+#ifdef NDEBUG
+#define ALWAYS_INLINE
+#else
+#define ALWAYS_INLINE __attribute__((always_inline))
+#endif
+
// bionic and glibc both have TEMP_FAILURE_RETRY, but Mac OS' libc doesn't.
#ifndef TEMP_FAILURE_RETRY
#define TEMP_FAILURE_RETRY(exp) ({ \