MagickCore
7.0.8
Convert, Edit, Or Compose Bitmap Images
|
#include "MagickCore/studio.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/exception.h"
#include "MagickCore/exception-private.h"
#include "MagickCore/memory_.h"
#include "MagickCore/memory-private.h"
#include "MagickCore/policy.h"
#include "MagickCore/resource_.h"
#include "MagickCore/semaphore.h"
#include "MagickCore/string_.h"
#include "MagickCore/string-private.h"
#include "MagickCore/utility-private.h"
Data Structures | |
struct | _DataSegmentInfo |
struct | _MagickMemoryMethods |
struct | _MemoryInfo |
struct | _MemoryPool |
Macros | |
#define | BlockFooter(block, size) ((size_t *) ((char *) (block)+(size)-2*sizeof(size_t))) |
#define | BlockHeader(block) ((size_t *) (block)-1) |
#define | BlockSize 4096 |
#define | BlockThreshold 1024 |
#define | MaxBlockExponent 16 |
#define | MaxBlocks ((BlockThreshold/(4*sizeof(size_t)))+MaxBlockExponent+1) |
#define | MaxSegments 1024 |
#define | MemoryGuard ((0xdeadbeef << 31)+0xdeafdeed) |
#define | NextBlock(block) ((char *) (block)+SizeOfBlock(block)) |
#define | NextBlockInList(block) (*(void **) (block)) |
#define | PreviousBlock(block) ((char *) (block)-(*((size_t *) (block)-2))) |
#define | PreviousBlockBit 0x01 |
#define | PreviousBlockInList(block) (*((void **) (block)+1)) |
#define | SegmentSize (2*1024*1024) |
#define | SizeMask (~0x01) |
#define | SizeOfBlock(block) (*BlockHeader(block) & SizeMask) |
#define | AlignedExtent(size, alignment) (((size)+((alignment)-1)) & ~((alignment)-1)) |
#define | AlignedPowerOf2(x) ((((x) - 1) & (x)) == 0) |
Typedefs | |
typedef struct _DataSegmentInfo | DataSegmentInfo |
typedef struct _MagickMemoryMethods | MagickMemoryMethods |
typedef struct _MemoryPool | MemoryPool |
Enumerations | |
enum | VirtualMemoryType { UndefinedVirtualMemory, AlignedVirtualMemory, MapVirtualMemory, UnalignedVirtualMemory } |
Variables | |
static size_t | max_memory_request = 0 |
static size_t | virtual_anonymous_memory = 0 |
static MagickMemoryMethods | memory_methods |
#define AlignedExtent | ( | size, | |
alignment | |||
) | (((size)+((alignment)-1)) & ~((alignment)-1)) |
Referenced by AcquireAlignedMemory().
#define AlignedPowerOf2 | ( | x | ) | ((((x) - 1) & (x)) == 0) |
Referenced by AcquireAlignedMemory().
#define BlockFooter | ( | block, | |
size | |||
) | ((size_t *) ((char *) (block)+(size)-2*sizeof(size_t))) |
Referenced by RelinquishMagickMemory().
#define BlockHeader | ( | block | ) | ((size_t *) (block)-1) |
Referenced by RelinquishMagickMemory().
#define BlockSize 4096 |
#define BlockThreshold 1024 |
#define MaxBlockExponent 16 |
#define MaxBlocks ((BlockThreshold/(4*sizeof(size_t)))+MaxBlockExponent+1) |
Referenced by AcquireMagickMemory().
#define MaxSegments 1024 |
Referenced by AcquireMagickMemory().
#define MemoryGuard ((0xdeadbeef << 31)+0xdeafdeed) |
#define NextBlock | ( | block | ) | ((char *) (block)+SizeOfBlock(block)) |
Referenced by RelinquishMagickMemory().
#define NextBlockInList | ( | block | ) | (*(void **) (block)) |
#define PreviousBlock | ( | block | ) | ((char *) (block)-(*((size_t *) (block)-2))) |
Referenced by RelinquishMagickMemory().
#define PreviousBlockBit 0x01 |
Referenced by RelinquishMagickMemory().
#define PreviousBlockInList | ( | block | ) | (*((void **) (block)+1)) |
#define SegmentSize (2*1024*1024) |
Referenced by AcquireMagickMemory().
#define SizeMask (~0x01) |
Referenced by AcquireMagickMemory(), and RelinquishMagickMemory().
#define SizeOfBlock | ( | block | ) | (*BlockHeader(block) & SizeMask) |
Referenced by RelinquishMagickMemory().
typedef struct _DataSegmentInfo DataSegmentInfo |
typedef struct _MagickMemoryMethods MagickMemoryMethods |
typedef struct _MemoryPool MemoryPool |
enum VirtualMemoryType |
MagickExport void* AcquireAlignedMemory | ( | const size_t | count, |
const size_t | quantum | ||
) |
References AcquireMagickMemory(), AlignedExtent, AlignedPowerOf2, CACHE_LINE_SIZE, HeapOverflowSanityCheck(), and MagickFalse.
Referenced by AcquireCacheNexusPixels(), AcquireContributionThreadSet(), AcquireKernelBuiltIn(), AcquirePixelCacheNexus(), AcquirePixelList(), AcquireStreamInfo(), AcquireStreamPixels(), AcquireVirtualCacheView(), AcquireVirtualMemory(), AdaptiveBlurImage(), AdaptiveSharpenImage(), CloneCacheView(), CloneKernelInfo(), EdgeImage(), EmbossImage(), GetMotionBlurKernel(), OpenPixelCache(), ParseKernelArray(), SelectiveBlurImage(), SharpenImage(), and WriteStreamImage().
MagickExport void* AcquireMagickMemory | ( | const size_t | size | ) |
References _MagickMemoryMethods::acquire_memory_handler, ActivateSemaphoreInfo(), _MemoryPool::allocation, _MemoryPool::blocks, LockSemaphoreInfo(), MagickFalse, MaxBlocks, MaxSegments, memory_methods, _DataSegmentInfo::next, _DataSegmentInfo::previous, _MemoryPool::segment_pool, SegmentSize, SizeMask, and UnlockSemaphoreInfo().
Referenced by AcquireAlignedMemory(), AcquireCoderCache(), AcquireColorCache(), AcquireCriticalMemory(), AcquireKernelBuiltIn(), AcquireMagicList(), AcquireMatrixInfo(), AcquirePixelList(), AcquirePolicyCache(), AcquireQuantumMemory(), AddChildToXMLTree(), AddConfigureKey(), AddValueToSplayTree(), AppendValueToLinkedList(), Ascii85Initialize(), CheckImageColors(), Classify(), CloneKernelInfo(), ConvertPathToPolygon(), GetCubeInfo(), GetImageDynamicThreshold(), GetNodeInfo(), InitializeIntervalTree(), InsertValueInLinkedList(), InsertValueInSortedLinkedList(), ListFiles(), NewXMLTreeTag(), ParseInternalDoctype(), RenderHoughLines(), RenderMVGContent(), ResizeMagickMemory(), SetImageInfo(), and ThrowException().
MagickExport void* AcquireQuantumMemory | ( | const size_t | count, |
const size_t | quantum | ||
) |
References AcquireMagickMemory(), HeapOverflowSanityCheck(), and MagickFalse.
Referenced by AcquireContributionThreadSet(), AcquireFxInfo(), AcquireFxThreadSet(), AcquireHistogramThreadSet(), AcquireImageColormap(), AcquireMagickMatrix(), AcquirePixelCacheNexus(), AcquirePixelChannelMap(), AcquirePixelListThreadSet(), AcquirePixelThreadSet(), AcquirePolygonThreadSet(), AcquireQuantumPixels(), AcquireRandomInfoThreadSet(), AcquireResampleFilterThreadSet(), AcquireSignatureInfo(), AcquireString(), AcquireStringInfo(), AcquireUniqueSymbolicLink(), AcquireVirtualMemory(), AnnotateImage(), AutoThresholdImage(), BalanceSplayTree(), Base64Decode(), Base64Encode(), BlobToStringInfo(), Classify(), ClassifyImageColors(), CloneDrawInfo(), CloneImage(), ClonePixelCacheOnDisk(), ClonePixelInfo(), ClutImage(), ColorDecisionListImage(), CompareImagesLayers(), ConfigureFileToStringInfo(), ConnectedComponentsImage(), ConstantString(), ContrastStretchImage(), ConvertLatin1ToUTF8(), ConvertPathToPolygon(), ConvertPrimitiveToPath(), ConvertUTF16ToUTF8(), CopyDelegateFile(), CreateMagickThreadKey(), CustomStreamToImage(), DeleteImages(), DeskewImage(), DistortImage(), DrawDashPolygon(), EqualizeImage(), EscapeParenthesis(), EscapeString(), ExpandFilenames(), ExportImagePixels(), FileToBlob(), FileToImage(), FileToXML(), GammaImage(), GaussJordanElimination(), GenerateCoefficients(), Get8BIMProperty(), GetCoderInfoList(), GetCoderList(), GetColorInfoList(), GetColorList(), GetCommandOptions(), GetConfigureInfoList(), GetConfigureList(), GetDelegateInfoList(), GetDelegateList(), GetExecutionPath(), GetEXIFProperty(), GetImageDepth(), GetImageDistortion(), GetImageDistortions(), GetImageDynamicThreshold(), GetImageFeatures(), GetImageHistogram(), GetImageMoments(), GetImagePerceptualHash(), GetImageStatistics(), GetImageViewException(), GetIPTCProperty(), GetLocaleInfoList(), GetLocaleList(), GetLocationStatistics(), GetLogInfoList(), GetLogList(), GetMagicInfoList(), GetMagickInfoList(), GetMagickList(), GetMagicList(), GetMimeInfoList(), GetMimeList(), GetNodeInfo(), GetPathComponents(), GetPolicyInfoList(), GetPolicyList(), GetThresholdMapFile(), GetTypeInfoList(), GetTypeList(), GetVirtualPixelCacheNexus(), GradientImage(), HuffmanDecodeImage(), HuffmanEncodeImage(), IdentifyImage(), ImageListToArray(), ImagesToBlob(), ImagesToCustomStream(), ImageToBlob(), ImageToCustomStream(), ImageToFile(), ImportImagePixels(), InitializeIntervalTree(), InjectImageBlob(), IterateOverSplayTree(), KapurThreshold(), LinearStretchImage(), ListFiles(), LZWEncodeImage(), MontageImageList(), MorphologyPrimitive(), MotionBlurImage(), NewXMLTree(), OptimalTau(), OptimizeLayerFrames(), OTSUThreshold(), PackbitsEncodeImage(), ParseEntities(), ParseInternalDoctype(), ParseKernelArray(), ParseProcessingInstructions(), ReduceImageColors(), RenderMVGContent(), RotationalBlurImage(), SampleImage(), ScaleImage(), ScaleSpace(), SegmentImage(), SetGrayscaleImage(), SetImageDepth(), SetStringInfoLength(), SetXMLTreeAttribute(), SortColormapByIntensity(), sRGBTransformImage(), StreamImagePixels(), StringInfoToHexString(), StringInfoToString(), StringToArgv(), StringToArrayOfDoubles(), StringToStrings(), TraceBezier(), TraceStrokePolygon(), TransformsRGBImage(), WaveImage(), and WaveletDenoiseImage().
MagickExport MemoryInfo* AcquireVirtualMemory | ( | const size_t | count, |
const size_t | quantum | ||
) |
References AcquireAlignedMemory(), AcquireQuantumMemory(), AcquireUniqueFileResource(), AlignedVirtualMemory, _MemoryInfo::blob, DestroyString(), _MemoryInfo::filename, GetMaxMemoryRequest(), GetPolicyValue(), HeapOverflowSanityCheck(), IOMode, _MemoryInfo::length, LocaleCompare(), MagickAssumeAligned, MagickCoreSignature, MagickFalse, MapBlob(), MapVirtualMemory, RelinquishUniqueFileResource(), RelinquishVirtualMemory(), ResourceLimitFatalError, _MemoryInfo::signature, ThrowFatalException, _MemoryInfo::type, UnalignedVirtualMemory, and virtual_anonymous_memory.
Referenced by AcquireQuantumPixels(), CLAHE(), CLAHEImage(), DespeckleImage(), FloodfillPaintImage(), GetCubeInfo(), LocalContrastImage(), and WaveletDenoiseImage().
MagickExport void* CopyMagickMemory | ( | void * | destination, |
const void * | source, | ||
const size_t | size | ||
) |
MagickExport void DestroyMagickMemory | ( | void | ) |
References ActivateSemaphoreInfo(), _DataSegmentInfo::allocation, _MagickMemoryMethods::destroy_memory_handler, _DataSegmentInfo::length, LockSemaphoreInfo(), MagickFalse, _DataSegmentInfo::mapped, memory_methods, _MemoryPool::number_segments, RelinquishSemaphoreInfo(), _MemoryPool::segments, UnlockSemaphoreInfo(), and UnmapBlob().
MagickExport void GetMagickMemoryMethods | ( | AcquireMemoryHandler * | acquire_memory_handler, |
ResizeMemoryHandler * | resize_memory_handler, | ||
DestroyMemoryHandler * | destroy_memory_handler | ||
) |
MagickExport size_t GetMaxMemoryRequest | ( | void | ) |
References DestroyString(), GetPolicyValue(), MagickULLConstant, max_memory_request, and StringToSizeType().
Referenced by AcquireVirtualMemory(), CheckPrimitiveExtent(), and TraceEllipse().
MagickExport void* GetVirtualMemoryBlob | ( | const MemoryInfo * | memory_info | ) |
References _MemoryInfo::blob, MagickCoreSignature, and _MemoryInfo::signature.
Referenced by AcquireQuantumPixels(), CLAHE(), CLAHEImage(), DespeckleImage(), DestroyQuantumPixels(), FloodfillPaintImage(), GetCubeInfo(), GetQuantumPixels(), LocalContrastImage(), and WaveletDenoiseImage().
MagickExport MagickBooleanType HeapOverflowSanityCheck | ( | const size_t | count, |
const size_t | quantum | ||
) |
References MagickFalse, and MagickTrue.
Referenced by AcquireAlignedMemory(), AcquireQuantumMemory(), AcquireVirtualMemory(), and ResizeQuantumMemory().
MagickExport void* RelinquishAlignedMemory | ( | void * | memory | ) |
References RelinquishMagickMemory().
Referenced by AdaptiveBlurImage(), AdaptiveSharpenImage(), DestroyCacheView(), DestroyContributionThreadSet(), DestroyKernelInfo(), DestroyPixelCache(), DestroyPixelCacheNexus(), DestroyPixelList(), DestroyPixelStream(), DestroyStreamInfo(), MotionBlurImage(), RelinquishCacheNexusPixels(), RelinquishPixelCachePixels(), RelinquishStreamPixels(), RelinquishVirtualMemory(), SelectiveBlurImage(), and WriteStreamImage().
MagickExport void* RelinquishMagickMemory | ( | void * | memory | ) |
References BlockFooter, BlockHeader, _MagickMemoryMethods::destroy_memory_handler, LockSemaphoreInfo(), memory_methods, NextBlock, PreviousBlock, PreviousBlockBit, SizeMask, SizeOfBlock, and UnlockSemaphoreInfo().
Referenced by access_utf8(), AcquireCoderCache(), AcquireFxInfo(), AcquireMagickMatrix(), AcquirePolygonThreadSet(), AcquireUniqueSymbolicLink(), AddPathToXMLTree(), AnnotateImage(), AutoThresholdImage(), BalanceSplayTree(), Base64Decode(), CanonicalXMLContent(), CheckPrimitiveExtent(), Classify(), ClearLinkedList(), ClonePixelCacheOnDisk(), ClutImage(), ColorDecisionListImage(), CompareImagesLayers(), ConnectedComponentsImage(), ContrastStretchImage(), ConvertPathToPolygon(), CopyDelegateFile(), CreateMagickThreadKey(), CustomStreamToImage(), DeleteImages(), DeleteMagickThreadKey(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), DeskewImage(), DestroyBlob(), DestroyCoderNode(), DestroyColorCube(), DestroyColorElement(), DestroyConfigureElement(), DestroyContributionThreadSet(), DestroyCubeInfo(), DestroyCustomStreamInfo(), DestroyDelegate(), DestroyDistributeCacheInfo(), DestroyDrawInfo(), DestroyEdge(), DestroyExceptionElement(), DestroyExceptionInfo(), DestroyFxInfo(), DestroyFxThreadSet(), DestroyHistogramThreadSet(), DestroyImage(), DestroyImageInfo(), DestroyImageView(), DestroyKernelInfo(), DestroyLinkedList(), DestroyLocaleNode(), DestroyLogElement(), DestroyMagicElement(), DestroyMagickNode(), DestroyMatrixInfo(), DestroyMimeElement(), DestroyMontageInfo(), DestroyPixelCacheNexus(), DestroyPixelChannelMap(), DestroyPixelList(), DestroyPixelListThreadSet(), DestroyPixelThreadSet(), DestroyPolicyElement(), DestroyPolygonInfo(), DestroyPolygonThreadSet(), DestroyQuantizeInfo(), DestroyQuantumInfo(), DestroyQuantumPixels(), DestroyRandomInfo(), DestroyRandomInfoThreadSet(), DestroyRegistryNode(), DestroyResampleFilter(), DestroyResampleFilterThreadSet(), DestroyResizeFilter(), DestroySignatureInfo(), DestroySplayTree(), DestroyStreamInfo(), DestroyString(), DestroyStringInfo(), DestroyStringList(), DestroyThresholdMap(), DestroyTimerInfo(), DestroyTokenInfo(), DestroyTypeNode(), DestroyXMLTree(), DestroyXMLTreeAttributes(), DestroyXMLTreeRoot(), DistortImage(), DrawDashPolygon(), DrawStrokePolygon(), EqualizeImage(), ExpandFilenames(), ExportImagePixels(), ExternalDelegateCommand(), FileToBlob(), FileToImage(), FileToXML(), fopen_utf8(), FreeNodes(), GammaImage(), GaussJordanElimination(), GenerateCoefficients(), GetConfigureOptions(), GetConfigurePaths(), GetDelegateCommand(), GetExecutionPath(), GetHostname(), GetImageDepth(), GetImageDistortion(), GetImageDistortions(), GetImageDynamicThreshold(), GetImageEntropy(), GetImageFeatures(), GetImageKurtosis(), GetImageMean(), GetImageMoments(), GetImagePerceptualHash(), GetImageStatistics(), GetLocaleOptions(), GetMagickHomeURL(), GetMultilineTypeMetrics(), GetMVGMacros(), GetNormalizedCrossCorrelationDistortion(), GetNumberColors(), GetPerceptualHashDistortion(), GetVirtualPixelCacheNexus(), GetXMLTreePath(), GetXMPProperty(), HuffmanDecodeImage(), HuffmanEncodeImage(), IdentifyImage(), ImagesToBlob(), ImagesToCustomStream(), ImageToBlob(), ImageToCustomStream(), ImageToFile(), ImportImagePixels(), InitializeIntervalTree(), InjectImageBlob(), InsertValueInSortedLinkedList(), InvokeDelegate(), IsOptionMember(), IterateOverSplayTree(), KapurThreshold(), LinearStretchImage(), ListCoderInfo(), ListColorInfo(), ListConfigureInfo(), ListDelegateInfo(), ListFiles(), ListLocaleInfo(), ListLogInfo(), ListMagicInfo(), ListMagickInfo(), ListMimeInfo(), ListPolicyInfo(), ListTypeInfo(), LoadColorCache(), LoadConfigureCache(), LoadDelegateCache(), LoadLocaleCache(), LoadLogCache(), LoadPolicyCache(), LoadTypeCache(), LogMagickEventList(), LZWEncodeImage(), MontageImageList(), MorphologyPrimitive(), MotionBlurImage(), open_utf8(), OptimalTau(), OptimizeLayerFrames(), OTSUThreshold(), PackbitsEncodeImage(), ParseInternalDoctype(), popen_utf8(), PreviewImage(), ReadInlineImage(), ReduceImageColors(), RelinquishAlignedMemory(), RelinquishMagickMatrix(), RelinquishVirtualMemory(), remove_utf8(), RemoveElementByValueFromLinkedList(), RemoveElementFromLinkedList(), RemoveLastElementFromLinkedList(), RemoveNodeByValueFromSplayTree(), RemoveNodeFromSplayTree(), rename_utf8(), RenderMVGContent(), RenderType(), ResetSplayTree(), ResizeMagickMemory(), ResizeQuantumMemory(), RotationalBlurImage(), SampleImage(), ScaleImage(), ScaleSpace(), SegmentImage(), SetGrayscaleImage(), SetImageArtifact(), SetImageDepth(), SetImageInfo(), SetImageOption(), SetImageProfileInternal(), SetImageProperty(), SetImageRegistry(), SetPolicyValue(), SortColormapByIntensity(), SparseColorImage(), sRGBTransformImage(), stat_utf8(), StreamImagePixels(), StringToArgv(), TraceBezier(), TraceStrokePolygon(), TransformsRGBImage(), WaveImage(), and WaveletDenoiseImage().
MagickExport MemoryInfo* RelinquishVirtualMemory | ( | MemoryInfo * | memory_info | ) |
References AlignedVirtualMemory, _MemoryInfo::blob, _MemoryInfo::filename, _MemoryInfo::length, MagickCoreSignature, MapVirtualMemory, RelinquishAlignedMemory(), RelinquishMagickMemory(), RelinquishUniqueFileResource(), _MemoryInfo::signature, _MemoryInfo::type, UnalignedVirtualMemory, and UnmapBlob().
Referenced by AcquireVirtualMemory(), CLAHE(), CLAHEImage(), DespeckleImage(), DestroyCubeInfo(), DestroyQuantumPixels(), FloodfillPaintImage(), LocalContrastImage(), and WaveletDenoiseImage().
MagickExport void* ResetMagickMemory | ( | void * | memory, |
int | byte, | ||
const size_t | size | ||
) |
Referenced by GetPixelInfoPixel().
MagickPrivate void ResetMaxMemoryRequest | ( | void | ) |
References max_memory_request.
MagickPrivate void ResetVirtualAnonymousMemory | ( | void | ) |
References virtual_anonymous_memory.
Referenced by SetMagickSecurityPolicyValue().
MagickExport void* ResizeMagickMemory | ( | void * | memory, |
const size_t | size | ||
) |
MagickExport void* ResizeQuantumMemory | ( | void * | memory, |
const size_t | count, | ||
const size_t | quantum | ||
) |
References HeapOverflowSanityCheck(), MagickFalse, RelinquishMagickMemory(), and ResizeMagickMemory().
Referenced by AcquireImageColormap(), CanonicalXMLContent(), CheckImageColors(), CheckPrimitiveExtent(), ClassifyImageColors(), CloneString(), ConcatenateString(), ConvertPathToPolygon(), ConvertPrimitiveToPath(), ConvertUTF16ToUTF8(), EncodePredefinedEntities(), ExpandFilenames(), FileToBlob(), FileToXML(), ImagesToBlob(), ImageToBlob(), ListFiles(), NewXMLTree(), ParseEntities(), ParseInternalDoctype(), ParseProcessingInstructions(), RenderMVGContent(), SetBlobExtent(), SetStringInfoLength(), SetXMLTreeAttribute(), StringToStrings(), SubstituteString(), TranslateEvent(), TranslateFilename(), WriteBlob(), XMLTreeInfoToXML(), and XMLTreeTagToXML().
MagickExport void SetMagickMemoryMethods | ( | AcquireMemoryHandler | acquire_memory_handler, |
ResizeMemoryHandler | resize_memory_handler, | ||
DestroyMemoryHandler | destroy_memory_handler | ||
) |
|
static |
Referenced by GetMaxMemoryRequest(), and ResetMaxMemoryRequest().
|
static |
Referenced by AcquireMagickMemory(), DestroyMagickMemory(), GetMagickMemoryMethods(), RelinquishMagickMemory(), ResizeMagickMemory(), and SetMagickMemoryMethods().
|
static |
Referenced by AcquireVirtualMemory(), and ResetVirtualAnonymousMemory().