From: Cristy Date: Sat, 17 Mar 2018 19:26:13 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.7-27~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e74958b76cd8259bb5153f1cf1a40afd363f3bb2;p=imagemagick ... --- diff --git a/MagickCore/cache.c b/MagickCore/cache.c index eeebb851e..928607e54 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -540,10 +540,8 @@ static MagickBooleanType ClonePixelCacheRepository( #define MaxCacheThreads ((size_t) GetMagickResourceLimit(ThreadResource)) #define cache_number_threads(source,destination,chunk,multithreaded) \ num_threads((multithreaded) == 0 ? 1 : \ - (((source)->type != MemoryCache) && \ - ((source)->type != MapCache)) || \ - (((destination)->type != MemoryCache) && \ - ((destination)->type != MapCache)) ? \ + (((source)->type != MemoryCache) && ((source)->type != MapCache)) || \ + (((destination)->type != MemoryCache) && ((destination)->type != MapCache)) ? \ MagickMax(MagickMin(GetMagickResourceLimit(ThreadResource),2),1) : \ MagickMax(MagickMin((ssize_t) GetMagickResourceLimit(ThreadResource),(ssize_t) (chunk)/256),1)) @@ -647,8 +645,7 @@ static MagickBooleanType ClonePixelCacheRepository( clone_nexus[id],exception); if (pixels == (Quantum *) NULL) continue; - (void) memset(clone_nexus[id]->pixels,0,(size_t) - clone_nexus[id]->length); + (void) memset(clone_nexus[id]->pixels,0,(size_t) clone_nexus[id]->length); if (optimize != MagickFalse) (void) memcpy(clone_nexus[id]->pixels,cache_nexus[id]->pixels,length* sizeof(Quantum)); @@ -1783,10 +1780,8 @@ MagickExport MagickBooleanType GetOneAuthenticPixel(Image *image, cache_info=(CacheInfo *) image->cache; assert(cache_info->signature == MagickCoreSignature); (void) memset(pixel,0,MaxPixelChannels*sizeof(*pixel)); - if (cache_info->methods.get_one_authentic_pixel_from_handler != - (GetOneAuthenticPixelFromHandler) NULL) - return(cache_info->methods.get_one_authentic_pixel_from_handler(image,x,y, - pixel,exception)); + if (cache_info->methods.get_one_authentic_pixel_from_handler != (GetOneAuthenticPixelFromHandler) NULL) + return(cache_info->methods.get_one_authentic_pixel_from_handler(image,x,y,pixel,exception)); q=GetAuthenticPixelsCache(image,x,y,1UL,1UL,exception); return(CopyPixel(image,q,pixel)); } @@ -2746,8 +2741,7 @@ MagickPrivate const Quantum *GetVirtualPixelsFromNexus(const Image *image, CacheError,"UnableToGetCacheNexus","`%s'",image->filename); return((const Quantum *) NULL); } - (void) memset(virtual_metacontent,0, - cache_info->metacontent_extent); + (void) memset(virtual_metacontent,0,cache_info->metacontent_extent); } switch (virtual_pixel_method) { @@ -4759,8 +4753,7 @@ static inline MagickBooleanType AcquireCacheNexusPixels( nexus_info->cache=(Quantum *) MagickAssumeAligned(AcquireAlignedMemory(1, (size_t) nexus_info->length)); if (nexus_info->cache != (Quantum *) NULL) - (void) memset(nexus_info->cache,0,(size_t) - nexus_info->length); + (void) memset(nexus_info->cache,0,(size_t) nexus_info->length); } else { diff --git a/MagickCore/image.c b/MagickCore/image.c index 3d42f6757..1f4e6eaed 100644 --- a/MagickCore/image.c +++ b/MagickCore/image.c @@ -2242,6 +2242,10 @@ MagickExport MagickBooleanType ResetImagePixels(Image *image, */ status=MagickTrue; image_view=AcquireAuthenticCacheView(image,exception); +#if defined(MAGICKCORE_OPENMP_SUPPORT) + #pragma omp parallel for schedule(static,4) shared(status) \ + magick_number_threads(image,image,image->rows,1) +#endif for (y=0; y < (ssize_t) image->rows; y++) { register Quantum @@ -2260,7 +2264,7 @@ MagickExport MagickBooleanType ResetImagePixels(Image *image, } for (x=0; x < (ssize_t) image->columns; x++) { - memset(q,0,GetPixelChannels(image)*sizeof(Quantum)); + (void) memset(q,0,GetPixelChannels(image)*sizeof(Quantum)); q+=GetPixelChannels(image); } if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) diff --git a/MagickCore/thread-private.h b/MagickCore/thread-private.h index bdd7be1fb..a4b757c78 100644 --- a/MagickCore/thread-private.h +++ b/MagickCore/thread-private.h @@ -38,7 +38,7 @@ extern "C" { ((GetImagePixelCacheType(destination) != MemoryCache) && \ (GetImagePixelCacheType(destination) != MapCache)) ? \ MagickMax(MagickMin(GetMagickResourceLimit(ThreadResource),2),1) : \ - MagickMax(MagickMin((ssize_t) GetMagickResourceLimit(ThreadResource),(ssize_t) (chunk)/64),1)) + MagickMax(MagickMin((ssize_t) GetMagickResourceLimit(ThreadResource),(ssize_t) (chunk)/256),1)) #if defined(__clang__) || (__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 10)) #define MagickCachePrefetch(address,mode,locality) \