Eina magic: add EINA_LIKELY.
authorTom Hacohen <tom@stosb.com>
Tue, 4 Sep 2012 08:00:27 +0000 (08:00 +0000)
committerTom Hacohen <tom@stosb.com>
Tue, 4 Sep 2012 08:00:27 +0000 (08:00 +0000)
This should improve performance as we use magic checks everywhere and it
lets the compiler do better optimisations.

SVN revision: 76113

legacy/eina/src/include/eina_magic.h

index 1da6c9b..5e8d376 100644 (file)
@@ -250,7 +250,7 @@ EAPI extern Eina_Error EINA_ERROR_MAGIC_FAILED;
  * If the magic feature of Eina is disabled, #EINA_MAGIC_CHECK is just
  * the value @c 1.
  */
-#define EINA_MAGIC_CHECK(d, m) ((d) && ((d)->__magic == (m)))
+#define EINA_MAGIC_CHECK(d, m) (EINA_LIKELY((d) && ((d)->__magic == (m))))
 
 /**
  * @def EINA_MAGIC_FAIL(d, m)