#include "magick/studio.h"#include "magick/cache.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/memory_.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/splay-tree.h"#include "magick/thread-private.h"#include "magick/token.h"#include "magick/utility.h"
Go to the source code of this file.
| #define O_NOFOLLOW 0 |
Referenced by AcquireUniqueFileResource().
| #define TMP_MAX 238328 |
Referenced by AcquireUniqueFileResource().
| typedef struct _ResourceInfo ResourceInfo |
| MagickExport MagickBooleanType AcquireMagickResource | ( | const ResourceType | type, | |
| const MagickSizeType | size | |||
| ) |
Definition at line 146 of file resource.c.
References AcquireSemaphoreInfo(), _ResourceInfo::area, _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file, _ResourceInfo::file_limit, FileResource, FormatMagickSize(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickFalse, MagickOptionToMnemonic(), 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::time, _ResourceInfo::time_limit, TimeResource, and UnlockSemaphoreInfo().
Referenced by AcquireRadonInfo(), OpenPixelCache(), and OpenPixelCacheOnDisk().
| MagickExport int AcquireUniqueFileResource | ( | char * | path | ) |
Definition at line 405 of file resource.c.
References AcquireRandomInfo(), AcquireSemaphoreInfo(), AddValueToSplayTree(), CompareSplayTreeString(), ConstantString(), DestroyStringInfo(), DestroyTemporaryResources(), GetMagickModule, GetPathTemplate(), GetRandomKey(), GetStringInfoDatum(), LockSemaphoreInfo(), LogMagickEvent(), NewSplayTree(), O_BINARY, O_NOFOLLOW, open, random_info, RelinquishMagickMemory(), resource_semaphore, ResourceEvent, S_MODE, setmode, temporary_resources, TMP_MAX, and UnlockSemaphoreInfo().
Referenced by AcquireRadonInfo(), AcquireUniqueFilename(), AcquireUniqueSymbolicLink(), BlobToFile(), ImagesToBlob(), ImageToBlob(), ImageToFile(), InjectImageBlob(), OpenPixelCacheOnDisk(), PreviewImage(), RenderPostscript(), and XDisplayImageInfo().
| MagickExport void AsynchronousResourceComponentTerminus | ( | void | ) |
Definition at line 285 of file resource.c.
References GetNextKeyInSplayTree(), ResetSplayTreeIterator(), and temporary_resources.
Referenced by MagickSignalHandler().
| static void* DestroyTemporaryResources | ( | void * | temporary_resource | ) | [static] |
Definition at line 329 of file resource.c.
Referenced by AcquireUniqueFileResource().
| MagickExport MagickSizeType GetMagickResource | ( | const ResourceType | type | ) |
Definition at line 506 of file resource.c.
References _ResourceInfo::area, AreaResource, _ResourceInfo::disk, DiskResource, _ResourceInfo::file, FileResource, LockSemaphoreInfo(), _ResourceInfo::map, MapResource, _ResourceInfo::memory, MemoryResource, resource_info, resource_semaphore, _ResourceInfo::thread, ThreadResource, _ResourceInfo::time, TimeResource, and UnlockSemaphoreInfo().
Referenced by LimitPixelCacheDescriptors().
| MagickExport MagickSizeType GetMagickResourceLimit | ( | const ResourceType | type | ) |
Definition at line 579 of file resource.c.
References AcquireSemaphoreInfo(), _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file_limit, FileResource, LockSemaphoreInfo(), _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, _ResourceInfo::thread_limit, ThreadResource, _ResourceInfo::time_limit, TimeResource, and UnlockSemaphoreInfo().
Referenced by GetImagePixelCache(), and LimitPixelCacheDescriptors().
| static MagickBooleanType GetPathTemplate | ( | char * | path | ) | [static] |
Definition at line 335 of file resource.c.
References AcquireExceptionInfo(), ConstantString(), CopyMagickString(), DestroyExceptionInfo(), DestroyString(), DirectorySeparator, FormatMagickString(), GetEnvironmentValue(), GetImageRegistry(), GetPathAttributes(), GetPolicyValue(), MagickFalse, MagickTrue, MaxTextExtent, S_ISDIR, stat, and StringRegistryType.
Referenced by AcquireUniqueFileResource().
| MagickExport MagickBooleanType ListMagickResourceInfo | ( | FILE * | file, | |
| ExceptionInfo * | magick_unusedexception | |||
| ) |
Definition at line 657 of file resource.c.
References AcquireSemaphoreInfo(), _ResourceInfo::area_limit, CopyMagickString(), _ResourceInfo::disk_limit, _ResourceInfo::file_limit, FormatMagickSize(), FormatMagickString(), LockSemaphoreInfo(), MagickResourceInfinity, MagickTrue, _ResourceInfo::map_limit, MaxTextExtent, _ResourceInfo::memory_limit, resource_info, resource_semaphore, _ResourceInfo::thread_limit, _ResourceInfo::time_limit, and UnlockSemaphoreInfo().
| static unsigned long MagickMax | ( | const unsigned long | x, | |
| const unsigned long | y | |||
| ) | [inline, static] |
Definition at line 869 of file resource.c.
Referenced by ResourceComponentGenesis().
| MagickExport void RelinquishMagickResource | ( | const ResourceType | type, | |
| const MagickSizeType | size | |||
| ) |
Definition at line 717 of file resource.c.
References AcquireSemaphoreInfo(), _ResourceInfo::area, _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file, _ResourceInfo::file_limit, FileResource, FormatMagickSize(), GetMagickModule, LockSemaphoreInfo(), LogMagickEvent(), MagickOptionToMnemonic(), MagickResourceOptions, _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::time, _ResourceInfo::time_limit, TimeResource, and UnlockSemaphoreInfo().
Referenced by AcquireRadonInfo(), ClosePixelCacheOnDisk(), DestroyRadonInfo(), OpenPixelCache(), and RelinquishPixelCachePixels().
| MagickExport MagickBooleanType RelinquishUniqueFileResource | ( | const char * | path | ) |
Definition at line 821 of file resource.c.
References AppendImageFormat(), CopyMagickString(), DeleteNodeFromSplayTree(), GetMagickModule, GetNextKeyInSplayTree(), LocaleCompare(), LogMagickEvent(), MagickFalse, MagickTrue, MaxTextExtent, ResetSplayTreeIterator(), ResourceEvent, and temporary_resources.
Referenced by AcquireUniqueSymbolicLink(), BlobToImage(), DestroyPixelCache(), DestroyRadonInfo(), ImagesToBlob(), ImageToBlob(), InjectImageBlob(), InvokeDelegate(), PreviewImage(), ReadImage(), RenderPostscript(), TemporaryFilename(), WriteImage(), and XDisplayImageInfo().
| MagickExport MagickBooleanType ResourceComponentGenesis | ( | void | ) |
Definition at line 889 of file resource.c.
References _SC_OPEN_MAX, _SC_PHYS_PAGES, AcquireSemaphoreInfo(), AreaResource, DestroyString(), DiskResource, FileResource, GetEnvironmentValue(), GetMagickPageSize(), GetOpenMPMaximumThreads(), GetPolicyValue(), MagickMax(), MagickTrue, MapResource, MemoryResource, resource_semaphore, SetMagickResourceLimit(), SetOpenMPMaximumThreads(), StringToSizeType(), sysconf, ThreadResource, and TimeResource.
Referenced by MagickCoreGenesis().
| MagickExport void ResourceComponentTerminus | ( | void | ) |
Definition at line 1023 of file resource.c.
References AcquireSemaphoreInfo(), DestroyRandomInfo(), DestroySemaphoreInfo(), DestroySplayTree(), LockSemaphoreInfo(), random_info, resource_semaphore, temporary_resources, and UnlockSemaphoreInfo().
Referenced by MagickCoreTerminus().
| MagickExport MagickBooleanType SetMagickResourceLimit | ( | const ResourceType | type, | |
| const MagickSizeType | limit | |||
| ) |
Definition at line 1061 of file resource.c.
References AcquireSemaphoreInfo(), _ResourceInfo::area_limit, AreaResource, _ResourceInfo::disk_limit, DiskResource, _ResourceInfo::file_limit, FileResource, GetOpenMPMaximumThreads(), LockSemaphoreInfo(), MagickTrue, _ResourceInfo::map_limit, MapResource, _ResourceInfo::memory_limit, MemoryResource, resource_info, resource_semaphore, SetOpenMPMaximumThreads(), _ResourceInfo::thread_limit, ThreadResource, _ResourceInfo::time_limit, TimeResource, and UnlockSemaphoreInfo().
Referenced by ResourceComponentGenesis(), and SetCacheThreshold().
| static MagickSizeType StringToSizeType | ( | const char * | string, | |
| const double | interval | |||
| ) | [inline, static] |
Definition at line 877 of file resource.c.
References MagickULLConstant, and StringToDouble().
Referenced by ResourceComponentGenesis().
RandomInfo* random_info = (RandomInfo *) NULL [static] |
Definition at line 92 of file resource.c.
Referenced by AcquireRandomInfo(), AcquireRandomInfoThreadSet(), AcquireUniqueFileResource(), AddNoiseImageChannel(), EvaluateImageChannel(), PlasmaImage(), RandomChannelThresholdImage(), RandomThresholdImageChannel(), ResourceComponentTerminus(), SketchImage(), and SpreadImage().
ResourceInfo resource_info [static] |
{
MagickULLConstant(0),
MagickULLConstant(0),
MagickULLConstant(0),
MagickULLConstant(0),
MagickULLConstant(0),
MagickULLConstant(0),
MagickULLConstant(0),
MagickULLConstant(2048)*1024*1024,
MagickULLConstant(1536)*1024*1024,
MagickULLConstant(8192)*1024*1024,
MagickResourceInfinity,
MagickULLConstant(768),
MagickULLConstant(8),
MagickResourceInfinity
}
Definition at line 95 of file resource.c.
Referenced by AcquireMagickResource(), GetMagickResource(), GetMagickResourceLimit(), ListMagickResourceInfo(), RelinquishMagickResource(), and SetMagickResourceLimit().
SemaphoreInfo* resource_semaphore = (SemaphoreInfo *) NULL [static] |
Definition at line 114 of file resource.c.
Referenced by AcquireMagickResource(), AcquireUniqueFileResource(), GetMagickResource(), GetMagickResourceLimit(), ListMagickResourceInfo(), RelinquishMagickResource(), ResourceComponentGenesis(), ResourceComponentTerminus(), and SetMagickResourceLimit().
SplayTreeInfo* temporary_resources = (SplayTreeInfo *) NULL [static] |
Definition at line 117 of file resource.c.
Referenced by AcquireUniqueFileResource(), AsynchronousResourceComponentTerminus(), RelinquishUniqueFileResource(), and ResourceComponentTerminus().
1.6.1