From: cristy Date: Thu, 10 Sep 2009 14:53:56 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~10740 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87528ea7f26177762f1fc81ff07e2608b8250e77;p=imagemagick --- diff --git a/magick/cache-private.h b/magick/cache-private.h index 37866dcbf..2d1e0df9b 100644 --- a/magick/cache-private.h +++ b/magick/cache-private.h @@ -121,6 +121,9 @@ typedef struct _CacheInfo CacheType type; + MapMode + mode; + MagickBooleanType mapped; diff --git a/magick/cache.c b/magick/cache.c index 80b746622..2794b159b 100644 --- a/magick/cache.c +++ b/magick/cache.c @@ -184,6 +184,7 @@ MagickExport Cache AcquirePixelCache(const unsigned long number_threads) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(cache_info,0,sizeof(*cache_info)); cache_info->type=UndefinedCache; + cache_info->mode=IOMode; cache_info->colorspace=RGBColorspace; cache_info->file=(-1); cache_info->id=GetMagickThreadId(); @@ -3910,6 +3911,7 @@ static MagickBooleanType OpenPixelCache(Image *image,const MapMode mode, source_info.file=(-1); (void) FormatMagickString(cache_info->filename,MaxTextExtent,"%s[%ld]", image->filename,GetImageIndexInList(image)); + cache_info->mode=mode; cache_info->rows=image->rows; cache_info->columns=image->columns; cache_info->active_index_channel=((image->storage_class == PseudoClass) || @@ -4169,13 +4171,13 @@ MagickExport MagickBooleanType PersistPixelCache(Image *image, { (void) CopyMagickString(cache_info->cache_filename,filename, MaxTextExtent); - cache_info=(CacheInfo *) ReferencePixelCache(cache_info); *offset+=cache_info->length+pagesize-(cache_info->length % pagesize); + (void) UnlockSemaphoreInfo(cache_info->semaphore); + cache_info=(CacheInfo *) ReferencePixelCache(cache_info); if (image->debug != MagickFalse) (void) LogMagickEvent(CacheEvent,GetMagickModule(), "Usurp resident persistent cache"); - (void) UnlockSemaphoreInfo(cache_info->semaphore); return(MagickTrue); } }