MagickCore 6.9.12
|
#include "magick/studio.h"
#include "magick/cache.h"
#include "magick/cache-private.h"
#include "magick/configure.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/hashmap.h"
#include "magick/log.h"
#include "magick/image.h"
#include "magick/image-private.h"
#include "magick/memory_.h"
#include "magick/nt-base-private.h"
#include "magick/option.h"
#include "magick/policy.h"
#include "magick/random_.h"
#include "magick/registry.h"
#include "magick/resource_.h"
#include "magick/semaphore.h"
#include "magick/signature-private.h"
#include "magick/string_.h"
#include "magick/string-private.h"
#include "magick/splay-tree.h"
#include "magick/thread-private.h"
#include "magick/token.h"
#include "magick/utility.h"
#include "magick/utility-private.h"
Go to the source code of this file.
Data Structures | |
struct | _ResourceInfo |
Macros | |
#define | MagickPathTemplate "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" /* min 6 X's */ |
#define | NumberOfResourceTypes (sizeof(resource_semaphore)/sizeof(*resource_semaphore)) |
#define | O_NOFOLLOW 0 |
#define | TMP_MAX 238328 |
Typedefs | |
typedef struct _ResourceInfo | ResourceInfo |
Variables | |
static RandomInfo * | random_info = (RandomInfo *) NULL |
static ResourceInfo | resource_info |
static SemaphoreInfo * | resource_semaphore [] |
static SplayTreeInfo * | temporary_resources = (SplayTreeInfo *) NULL |
#define MagickPathTemplate "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" /* min 6 X's */ |
Definition at line 72 of file resource.c.
#define NumberOfResourceTypes (sizeof(resource_semaphore)/sizeof(*resource_semaphore)) |
Definition at line 73 of file resource.c.
#define O_NOFOLLOW 0 |
#define TMP_MAX 238328 |
typedef struct _ResourceInfo ResourceInfo |
MagickExport MagickBooleanType AcquireMagickResource | ( | const ResourceType | type, |
const MagickSizeType | size | ||
) |
Definition at line 187 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area, _ResourceInfo::area_limit, AreaResource, CommandOptionToMnemonic(), _ResourceInfo::disk, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file, _ResourceInfo::file_limit, FileResource, FormatMagickSize(), GetLogEventMask(), GetMagickModule, _ResourceInfo::height, _ResourceInfo::height_limit, HeightResource, _ResourceInfo::list_length, _ResourceInfo::list_length_limit, ListLengthResource, LockSemaphoreInfo(), LogMagickEvent(), MagickFalse, MagickResourceInfinity, MagickResourceOptions, MagickTrue, _ResourceInfo::map, _ResourceInfo::map_limit, MapResource, MaxTextExtent, _ResourceInfo::memory, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, ResourceEvent, _ResourceInfo::thread, _ResourceInfo::thread_limit, ThreadResource, _ResourceInfo::throttle, _ResourceInfo::throttle_limit, ThrottleResource, _ResourceInfo::time, _ResourceInfo::time_limit, TimeResource, UnlockSemaphoreInfo(), _ResourceInfo::width, _ResourceInfo::width_limit, and WidthResource.
Referenced by AcquireMatrixInfo(), CloneBlobInfo(), GetMultilineTypeMetrics(), OpenBlob(), OpenPixelCache(), OpenPixelCacheOnDisk(), PersistPixelCache(), SetBlobExtent(), and WaveletDenoiseImage().
MagickExport int AcquireUniqueFileResource | ( | char * | path | ) |
Definition at line 600 of file resource.c.
References AcquireRandomInfo(), ActivateSemaphoreInfo(), AddValueToSplayTree(), CompareSplayTreeString(), ConstantString(), DestroyStringInfo(), DestroyTemporaryResources(), FileResource, GetLogEventMask(), GetMagickModule, GetPathTemplate(), GetRandomKey(), GetStringInfoDatum(), GetStringInfoLength(), LockSemaphoreInfo(), LogMagickEvent(), MagickPathTemplate, NewSplayTree(), O_BINARY, O_NOFOLLOW, open_utf8(), random_info, resource_semaphore, ResourceEvent, S_MODE, temporary_resources, TMP_MAX, and UnlockSemaphoreInfo().
Referenced by AcquireMatrixInfo(), AcquireUniqueFilename(), AcquireUniqueSymbolicLink(), AcquireVirtualMemory(), BlobToFile(), HoughLineImage(), ImagesToBlob(), ImageToBlob(), ImageToFile(), InjectImageBlob(), OpenPixelCacheOnDisk(), PreviewImage(), and RenderPostscript().
MagickExport void AsynchronousResourceComponentTerminus | ( | void | ) |
Definition at line 466 of file resource.c.
References GetNextKeyInSplayTree(), ResetSplayTreeIterator(), ShredFile(), and temporary_resources.
Referenced by MagickCoreTerminus(), and MagickSignalHandler().
|
static |
Definition at line 510 of file resource.c.
References DestroyString(), and ShredFile().
Referenced by AcquireUniqueFileResource().
|
static |
Definition at line 943 of file resource.c.
References FormatLocaleString(), MagickFalse, and MaxTextExtent.
Referenced by ListMagickResourceInfo().
MagickExport MagickSizeType GetMagickResource | ( | const ResourceType | type | ) |
Definition at line 725 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area, AreaResource, _ResourceInfo::disk, DiskResource, _ResourceInfo::file, FileResource, _ResourceInfo::height, HeightResource, _ResourceInfo::list_length, ListLengthResource, LockSemaphoreInfo(), _ResourceInfo::map, MapResource, _ResourceInfo::memory, MemoryResource, resource_info, resource_semaphore, _ResourceInfo::thread, ThreadResource, _ResourceInfo::throttle, ThrottleResource, _ResourceInfo::time, TimeResource, UnlockSemaphoreInfo(), _ResourceInfo::width, and WidthResource.
MagickExport MagickSizeType GetMagickResourceLimit | ( | const ResourceType | type | ) |
Definition at line 844 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file_limit, FileResource, _ResourceInfo::height_limit, HeightResource, _ResourceInfo::list_length_limit, ListLengthResource, LockSemaphoreInfo(), _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, _ResourceInfo::thread_limit, ThreadResource, _ResourceInfo::throttle_limit, ThrottleResource, _ResourceInfo::time_limit, TimeResource, UnlockSemaphoreInfo(), _ResourceInfo::width_limit, and WidthResource.
Referenced by AcquireContributionTLS(), AcquireFxTLS(), AcquireHistogramTLS(), AcquirePixelCache(), AcquirePixelListTLS(), AcquirePixelTLS(), AcquirePolygonTLS(), AcquireQuantumPixels(), AcquireRandomInfoTLS(), AcquireResampleFilterTLS(), AcquireVirtualCacheView(), DestroyContributionTLS(), DestroyFxTLS(), DestroyHistogramTLS(), DestroyPixelListTLS(), DestroyPixelTLS(), DestroyPolygonTLS(), DestroyRandomInfoTLS(), DestroyResampleFilterTLS(), GetImageChannelDepth(), GetImagePixelCache(), GetMagickNumberThreads(), NewImageView(), NewImageViewRegion(), OpenPixelCache(), and SetImageViewThreads().
MagickExport MagickBooleanType GetPathTemplate | ( | char * | path | ) |
Definition at line 517 of file resource.c.
References AcquireExceptionInfo(), CloneString(), ConstantString(), DestroyExceptionInfo(), DestroyString(), DirectorySeparator, FormatLocaleString(), GetEnvironmentValue(), GetImageRegistry(), GetPathAttributes(), GetPolicyValue(), MagickFalse, MagickPathTemplate, MagickTrue, MaxTextExtent, S_ISDIR, and StringRegistryType.
Referenced by AcquireUniqueFileResource().
MagickExport MagickBooleanType ListMagickResourceInfo | ( | FILE * | file, |
ExceptionInfo * | magick_unusedexception | ||
) |
Definition at line 995 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area_limit, CopyMagickString(), _ResourceInfo::disk_limit, _ResourceInfo::file_limit, FileResource, FormatLocaleFile(), FormatLocaleString(), FormatMagickSize(), FormatPixelSize(), _ResourceInfo::height_limit, _ResourceInfo::list_length_limit, LockSemaphoreInfo(), magick_unreferenced, MagickFalse, MagickResourceInfinity, MagickTrue, _ResourceInfo::map_limit, MaxTextExtent, _ResourceInfo::memory_limit, resource_info, resource_semaphore, _ResourceInfo::thread_limit, _ResourceInfo::throttle_limit, _ResourceInfo::time_limit, UnlockSemaphoreInfo(), and _ResourceInfo::width_limit.
MagickExport void RelinquishMagickResource | ( | const ResourceType | type, |
const MagickSizeType | size | ||
) |
Definition at line 1076 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area, _ResourceInfo::area_limit, AreaResource, CommandOptionToMnemonic(), _ResourceInfo::disk, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file, _ResourceInfo::file_limit, FileResource, FormatMagickSize(), GetLogEventMask(), GetMagickModule, _ResourceInfo::height, _ResourceInfo::height_limit, HeightResource, _ResourceInfo::list_length, _ResourceInfo::list_length_limit, ListLengthResource, LockSemaphoreInfo(), LogMagickEvent(), MagickFalse, MagickResourceOptions, MagickTrue, _ResourceInfo::map, _ResourceInfo::map_limit, MapResource, MaxTextExtent, _ResourceInfo::memory, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, ResourceEvent, _ResourceInfo::thread, _ResourceInfo::thread_limit, ThreadResource, _ResourceInfo::throttle, _ResourceInfo::throttle_limit, ThrottleResource, _ResourceInfo::time, _ResourceInfo::time_limit, TimeResource, UnlockSemaphoreInfo(), _ResourceInfo::width, _ResourceInfo::width_limit, and WidthResource.
Referenced by AcquireMatrixInfo(), ClosePixelCacheOnDisk(), DestroyBlob(), DestroyMatrixInfo(), DetachBlob(), OpenBlob(), OpenPixelCache(), RelinquishPixelCachePixels(), and SetBlobExtent().
MagickExport MagickBooleanType RelinquishUniqueFileResource | ( | const char * | path | ) |
Definition at line 1289 of file resource.c.
References access_utf8(), ActivateSemaphoreInfo(), AppendImageFormat(), CopyMagickString(), DeleteNodeFromSplayTree(), FileResource, GetLogEventMask(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickFalse, MaxTextExtent, resource_semaphore, ResourceEvent, ShredFile(), temporary_resources, and UnlockSemaphoreInfo().
Referenced by AcquireUniqueSymbolicLink(), AcquireVirtualMemory(), BlobToImage(), DestroyMatrixInfo(), HoughLineImage(), ImagesToBlob(), ImageToBlob(), InjectImageBlob(), InvokeDelegate(), PingBlob(), PreviewImage(), ReadImage(), RelinquishPixelCachePixels(), RelinquishVirtualMemory(), RenderPostscript(), SetImageInfo(), TemporaryFilename(), and WriteImage().
MagickExport MagickBooleanType ResourceComponentGenesis | ( | void | ) |
Definition at line 1334 of file resource.c.
References ActivateSemaphoreInfo(), AreaResource, DestroyString(), DiskResource, FileResource, GetEnvironmentValue(), GetMagickPageSize(), GetOpenMPMaximumThreads(), _ResourceInfo::height_limit, HeightResource, ListLengthResource, MagickMax, MagickResourceInfinity, MagickTrue, MapResource, MemoryResource, NumberOfResourceTypes, resource_info, resource_semaphore, SetMagickResourceLimit(), StringToSizeType(), ThreadResource, ThrottleResource, TimeResource, _ResourceInfo::width_limit, and WidthResource.
Referenced by MagickCoreGenesis(), and SetMagickSecurityPolicy().
MagickExport void ResourceComponentTerminus | ( | void | ) |
Definition at line 1495 of file resource.c.
References ActivateSemaphoreInfo(), DestroyRandomInfo(), DestroySemaphoreInfo(), DestroySplayTree(), FileResource, LockSemaphoreInfo(), NumberOfResourceTypes, random_info, resource_semaphore, temporary_resources, and UnlockSemaphoreInfo().
Referenced by MagickCoreTerminus().
MagickExport MagickBooleanType SetMagickResourceLimit | ( | const ResourceType | type, |
const MagickSizeType | limit | ||
) |
Definition at line 1539 of file resource.c.
References ActivateSemaphoreInfo(), _ResourceInfo::area_limit, AreaResource, DestroyString(), _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file_limit, FileResource, GetOpenMPMaximumThreads(), GetPolicyValue(), _ResourceInfo::height_limit, HeightResource, _ResourceInfo::list_length_limit, ListLengthResource, LockSemaphoreInfo(), MAGICK_SSIZE_MAX, MagickFalse, MagickMax, MagickMin, MagickTrue, _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory_limit, MemoryResource, ResetPixelCacheEpoch(), resource_info, resource_semaphore, StringToSizeType(), _ResourceInfo::thread_limit, ThreadResource, _ResourceInfo::throttle_limit, ThrottleResource, _ResourceInfo::time_limit, TimeResource, UnlockSemaphoreInfo(), _ResourceInfo::width_limit, and WidthResource.
Referenced by ResourceComponentGenesis(), and SetCacheThreshold().
|
static |
Definition at line 112 of file resource.c.
Referenced by AcquireRandomInfo(), AcquireRandomInfoTLS(), AcquireUniqueFileResource(), AddNoiseImageChannel(), ApplyEvaluateOperator(), DestroyRandomInfo(), DestroyRandomInfoTLS(), DistributePixelCacheClient(), EvaluateImageChannel(), EvaluateImages(), GenerateDifferentialNoise(), GenerateEntropicChaos(), GetPseudoRandomValue(), GetRandomInfoNormalize(), GetRandomInfoSeed(), GetRandomKey(), GetRandomSecretKey(), GetRandomValue(), PlasmaImage(), PlasmaImageProxy(), PlasmaPixel(), RandomChannelThresholdImage(), RandomThresholdImageChannel(), RandomX(), RandomY(), ResourceComponentTerminus(), SetRandomKey(), ShredFile(), SketchImage(), and SpreadImage().
|
static |
Definition at line 115 of file resource.c.
Referenced by AcquireMagickResource(), GetMagickResource(), GetMagickResourceLimit(), ListMagickResourceInfo(), RelinquishMagickResource(), ResourceComponentGenesis(), and SetMagickResourceLimit().
|
static |
Definition at line 142 of file resource.c.
Referenced by AcquireMagickResource(), AcquireUniqueFileResource(), GetMagickResource(), GetMagickResourceLimit(), ListMagickResourceInfo(), RelinquishMagickResource(), RelinquishUniqueFileResource(), ResourceComponentGenesis(), ResourceComponentTerminus(), and SetMagickResourceLimit().
|
static |
Definition at line 158 of file resource.c.
Referenced by AcquireUniqueFileResource(), AsynchronousResourceComponentTerminus(), RelinquishUniqueFileResource(), and ResourceComponentTerminus().