summaryrefslogtreecommitdiffstats
path: root/vm/Common.h
diff options
context:
space:
mode:
authorCarl Shapiro <cshapiro@google.com>2010-07-29 21:22:12 -0700
committerCarl Shapiro <cshapiro@google.com>2010-07-30 15:38:45 -0700
commita20a99298b45b4b6c7c9c528066a3e055e601535 (patch)
tree8509abd2506f1b73e469d93d86823cf12fe1ce22 /vm/Common.h
parent577534a45611f2011cbfa5aa99590e8ef565250e (diff)
downloadandroid_dalvik-a20a99298b45b4b6c7c9c528066a3e055e601535.tar.gz
android_dalvik-a20a99298b45b4b6c7c9c528066a3e055e601535.tar.bz2
android_dalvik-a20a99298b45b4b6c7c9c528066a3e055e601535.zip
Move LIKELY and UNLIKELY to a public header file.
Change-Id: I6c4429277f50ff34021bd2ef836834605323b9bd
Diffstat (limited to 'vm/Common.h')
-rw-r--r--vm/Common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm/Common.h b/vm/Common.h
index 2f151b8fe..ae0938aea 100644
--- a/vm/Common.h
+++ b/vm/Common.h
@@ -37,6 +37,9 @@
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#define MAX(x,y) (((x) > (y)) ? (x) : (y))
+#define LIKELY(exp) (__builtin_expect((exp) != 0, true))
+#define UNLIKELY(exp) (__builtin_expect((exp) != 0, false))
+
/*
* If "very verbose" logging is enabled, make it equivalent to LOGV.
* Otherwise, make it disappear.