18 #ifndef MAGICKCORE_MEMORY_PRIVATE_H 19 #define MAGICKCORE_MEMORY_PRIVATE_H 21 #include "magick/magick-config.h" 23 #if defined(__cplusplus) || defined(c_plusplus) 27 #if defined(__powerpc__) 28 # define CACHE_LINE_SIZE (16 * MAGICKCORE_SIZEOF_VOID_P) 30 # define CACHE_LINE_SIZE (8 * MAGICKCORE_SIZEOF_VOID_P) 33 #define CACHE_ALIGNED(n) MAGICKCORE_ALIGN_UP(n,CACHE_LINE_SIZE) 35 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) 37 #define MagickAssumeAligned(address) \ 38 __builtin_assume_aligned((address),CACHE_LINE_SIZE) 40 #define MagickAssumeAligned(address) (address) 43 #define MagickAssumeAligned(address) (address) 46 static inline MagickBooleanType HeapOverflowCheckAdd(
const size_t size,
47 const size_t increment)
49 if (size > (MAGICK_SIZE_MAX-increment))
57 static inline size_t OverAllocateMemory(
const size_t length)
67 for (extent=256; extent < length; extent*=2);
71 extern MagickPrivate MagickBooleanType
72 ShredMagickMemory(
void *,
const size_t);
74 extern MagickPrivate
void 75 ResetMaxMemoryRequest(
void),
76 ResetVirtualAnonymousMemory(
void),
77 SetMaxMemoryRequest(
const MagickSizeType);
79 #if defined(__cplusplus) || defined(c_plusplus)