18#ifndef MAGICKCORE_MEMORY_PRIVATE_H
19#define MAGICKCORE_MEMORY_PRIVATE_H
21#include "MagickCore/magick-config.h"
24#if defined(__cplusplus) || defined(c_plusplus)
28#if defined(__powerpc__)
29# define CACHE_LINE_SIZE (16 * MAGICKCORE_SIZEOF_VOID_P)
31# define CACHE_LINE_SIZE (8 * MAGICKCORE_SIZEOF_VOID_P)
34#define CACHE_ALIGNED(n) MAGICKCORE_ALIGN_UP(n,CACHE_LINE_SIZE)
36#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6))
38#define MagickAssumeAligned(address) \
39 __builtin_assume_aligned((address),CACHE_LINE_SIZE)
41#define MagickAssumeAligned(address) (address)
44#define MagickAssumeAligned(address) (address)
47static inline MagickBooleanType HeapOverflowCheckAdd(
const size_t size,
48 const size_t increment)
50 if (size > (SIZE_MAX-increment))
58static inline size_t OverAllocateMemory(
const size_t length)
68 for (extent=256; extent < length; extent*=2);
72extern MagickPrivate MagickBooleanType
73 ShredMagickMemory(
void *,
const size_t);
75extern MagickPrivate
void
76 ResetMaxMemoryRequest(
void),
77 ResetVirtualAnonymousMemory(
void),
78 SetMaxMemoryRequest(
const MagickSizeType),
79 SetMaxProfileSize(
const MagickSizeType);
81#if defined(__cplusplus) || defined(c_plusplus)