]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/memory-private.h
(no commit message)
[imagemagick] / MagickCore / memory-private.h
index d711a20dc2a25077a128ee7e743214bb4fa2f3d3..ca1cfbf9394b5fe1240d2f28c28fc71650f3518b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
   
   You may not use this file except in compliance with the License.
 extern "C" {
 #endif
 
-#define CACHE_LINE_SIZE  (16*sizeof(void *))
+
+#if defined(MAGICK_TARGET_CPU) && (MAGICK_TARGET_CPU == powerpc)
+#  define CACHE_LINE_SIZE  128
+#else
+#  define CACHE_LINE_SIZE  64
+#endif
+
 #define CacheAlign(size)  ((size) < CACHE_LINE_SIZE ? CACHE_LINE_SIZE : (size))
 
+#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6))
+#if !defined(__ICC)
+#define MagickAssumeAligned(address) \
+  __builtin_assume_aligned((address),CACHE_LINE_SIZE)
+#else
+#define MagickAssumeAligned(address)  (address)
+#endif
+#else
+#define MagickAssumeAligned(address)  (address)
+#endif
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif