From: cristy Date: Sun, 29 Jul 2012 23:30:07 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27d53d6693941cf35348f714bd847bc187fd281f;p=imagemagick --- diff --git a/MagickCore/cache-view.c b/MagickCore/cache-view.c index 5127bdb89..84eecb1f1 100644 --- a/MagickCore/cache-view.c +++ b/MagickCore/cache-view.c @@ -160,7 +160,7 @@ MagickExport CacheView *AcquireVirtualCacheView(const Image *image, if (image->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); (void) exception; - cache_view=(CacheView *) AcquireQuantumMemory(1,sizeof(*cache_view)); + cache_view=(CacheView *) AcquireAlignedMemory(1,sizeof(*cache_view)); if (cache_view == (CacheView *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(cache_view,0,sizeof(*cache_view)); @@ -207,7 +207,7 @@ MagickExport CacheView *CloneCacheView(const CacheView *cache_view) if (cache_view->debug != MagickFalse) (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", cache_view->image->filename); - clone_view=(CacheView *) AcquireQuantumMemory(1,sizeof(*clone_view)); + clone_view=(CacheView *) AcquireAlignedMemory(1,sizeof(*clone_view)); if (clone_view == (CacheView *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(clone_view,0,sizeof(*clone_view)); @@ -255,7 +255,7 @@ MagickExport CacheView *DestroyCacheView(CacheView *cache_view) cache_view->number_threads); cache_view->image=DestroyImage(cache_view->image); cache_view->signature=(~MagickSignature); - cache_view=(CacheView *) RelinquishMagickMemory(cache_view); + cache_view=(CacheView *) RelinquishAlignedMemory(cache_view); return(cache_view); } diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h index 05d3b0e4b..8368f9364 100644 --- a/MagickCore/magick-config.h +++ b/MagickCore/magick-config.h @@ -1271,6 +1271,21 @@ /* Define to prepend to default font search path. */ /* #undef MAGICK_FONT_PATH */ +/* Target Host CPU */ +#ifndef MAGICKCORE_MAGICK_TARGET_CPU +#define MAGICKCORE_MAGICK_TARGET_CPU x86_64 +#endif + +/* Target Host OS */ +#ifndef MAGICKCORE_MAGICK_TARGET_OS +#define MAGICKCORE_MAGICK_TARGET_OS linux-gnu +#endif + +/* Target Host Vendor */ +#ifndef MAGICKCORE_MAGICK_TARGET_VENDOR +#define MAGICKCORE_MAGICK_TARGET_VENDOR unknown +#endif + /* Magick API method prefix */ /* #undef NAMESPACE_PREFIX */ diff --git a/MagickCore/memory.c b/MagickCore/memory.c index 4b6f01ef1..fa6bdcb89 100644 --- a/MagickCore/memory.c +++ b/MagickCore/memory.c @@ -188,6 +188,9 @@ static MagickBooleanType */ MagickExport void *AcquireAlignedMemory(const size_t count,const size_t quantum) { +#define AlignedExtent(size,alignment) \ + (((size)+((alignment)-1)) & ~((alignment)-1)) + size_t alignment, extent, @@ -204,11 +207,11 @@ MagickExport void *AcquireAlignedMemory(const size_t count,const size_t quantum) } memory=NULL; alignment=CACHE_LINE_SIZE; - extent=(size+alignment-1)+sizeof(void *); - if ((size == 0) || (alignment < sizeof(void *)) || (extent <= size)) + extent=AlignedExtent(size,alignment); + if ((size == 0) || (alignment < sizeof(void *)) || (extent < size)) return((void *) NULL); #if defined(MAGICKCORE_HAVE_POSIX_MEMALIGN) - if (posix_memalign(&memory,alignment,size) != 0) + if (posix_memalign(&memory,alignment,extent) != 0) memory=NULL; #elif defined(MAGICKCORE_HAVE__ALIGNED_MALLOC) memory=_aligned_malloc(size,alignment); @@ -217,12 +220,15 @@ MagickExport void *AcquireAlignedMemory(const size_t count,const size_t quantum) void *p; - p=malloc(extent); - if (p != NULL) + extent=(size+alignment-1)+sizeof(void *); + if (extent > size) { - memory=(void *) (((size_t) p+sizeof(void *)+alignment-1) & - ~(alignment-1)); - *((void **) memory-1)=p; + p=malloc(extent); + if (p != NULL) + { + memory=(void *) AlignedExtent((size_t) p+sizeof(void *),alignment); + *((void **) memory-1)=p; + } } } #endif diff --git a/MagickCore/semaphore.c b/MagickCore/semaphore.c index 755f0c799..97b3aea0d 100644 --- a/MagickCore/semaphore.c +++ b/MagickCore/semaphore.c @@ -125,6 +125,9 @@ MagickExport void AcquireSemaphoreInfo(SemaphoreInfo **semaphore_info) static void *AcquireSemaphoreMemory(const size_t count,const size_t quantum) { +#define AlignedExtent(size,alignment) \ + (((size)+((alignment)-1)) & ~((alignment)-1)) + size_t alignment, extent, @@ -141,11 +144,11 @@ static void *AcquireSemaphoreMemory(const size_t count,const size_t quantum) } memory=NULL; alignment=CACHE_LINE_SIZE; - extent=(size+alignment-1)+sizeof(void *); - if ((size == 0) || (alignment < sizeof(void *)) || (extent <= size)) + extent=AlignedExtent(size,alignment); + if ((size == 0) || (alignment < sizeof(void *)) || (extent < size)) return((void *) NULL); #if defined(MAGICKCORE_HAVE_POSIX_MEMALIGN) - if (posix_memalign(&memory,alignment,size) != 0) + if (posix_memalign(&memory,alignment,extent) != 0) memory=NULL; #elif defined(MAGICKCORE_HAVE__ALIGNED_MALLOC) memory=_aligned_malloc(size,alignment); @@ -154,12 +157,15 @@ static void *AcquireSemaphoreMemory(const size_t count,const size_t quantum) void *p; - p=malloc(extent); - if (p != NULL) + extent=(size+alignment-1)+sizeof(void *); + if (extent > size) { - memory=(void *) (((size_t) p+sizeof(void *)+alignment-1) & - ~(alignment-1)); - *((void **) memory-1)=p; + p=malloc(extent); + if (p != NULL) + { + memory=(void *) AlignedExtent((size_t) p+sizeof(void *),alignment); + *((void **) memory-1)=p; + } } } #endif diff --git a/MagickCore/version.h b/MagickCore/version.h index 8924db8f3..9b7d08fdf 100644 --- a/MagickCore/version.h +++ b/MagickCore/version.h @@ -27,14 +27,14 @@ extern "C" { */ #define MagickPackageName "ImageMagick" #define MagickCopyright "Copyright (C) 1999-2012 ImageMagick Studio LLC" -#define MagickSVNRevision "8726" +#define MagickSVNRevision "8756" #define MagickLibVersion 0x700 #define MagickLibVersionText "7.0.0" #define MagickLibVersionNumber 7,0,0 #define MagickLibAddendum "-0" #define MagickLibInterface 7 #define MagickLibMinInterface 7 -#define MagickReleaseDate "2012-07-28" +#define MagickReleaseDate "2012-07-29" #define MagickChangeDate "20110801" #define MagickAuthoritativeURL "http://www.imagemagick.org" #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/config/ImageMagick.rdf b/config/ImageMagick.rdf index b08d55f4d..6aa2b3c3f 100644 --- a/config/ImageMagick.rdf +++ b/config/ImageMagick.rdf @@ -5,7 +5,7 @@ ImageMagick ImageMagick: convert, edit, and compose images. - 2012-07-28 + 2012-07-29 ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. @@ -57,7 +57,7 @@ Examples of ImageMagick Usage shows how to use ImageMagick from the command-line stable - 2012-07-28 + 2012-07-29 7.0.0 -0 diff --git a/config/config.h.in b/config/config.h.in index 314b78a3d..47874f163 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -836,6 +836,15 @@ /* Define to prepend to default font search path. */ #undef MAGICK_FONT_PATH +/* Target Host CPU */ +#undef MAGICK_TARGET_CPU + +/* Target Host OS */ +#undef MAGICK_TARGET_OS + +/* Target Host Vendor */ +#undef MAGICK_TARGET_VENDOR + /* Magick API method prefix */ #undef NAMESPACE_PREFIX diff --git a/config/configure.xml b/config/configure.xml index 58fe37a2f..18b11797d 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -10,8 +10,8 @@ - - + + diff --git a/configure b/configure index c2823cff6..7c6f13005 100755 --- a/configure +++ b/configure @@ -3640,18 +3640,33 @@ test -n "$target_alias" && MAGICK_TARGET_CPU=$host_cpu +cat >>confdefs.h <<_ACEOF +#define MAGICK_TARGET_CPU $MAGICK_TARGET_CPU +_ACEOF + + MAGICK_TARGET_VENDOR=$host_vendor +cat >>confdefs.h <<_ACEOF +#define MAGICK_TARGET_VENDOR $MAGICK_TARGET_VENDOR +_ACEOF + + MAGICK_TARGET_OS=$host_os +cat >>confdefs.h <<_ACEOF +#define MAGICK_TARGET_OS $MAGICK_TARGET_OS +_ACEOF + + # Substitute library versioning MAGICK_LIBRARY_CURRENT_MIN=`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE` MAGICK_LIBRARY_VERSION_INFO=$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE -MAGICK_SVN_REVISION=8726 +MAGICK_SVN_REVISION=8756 diff --git a/configure.ac b/configure.ac index ebb09d009..3d52d5507 100755 --- a/configure.ac +++ b/configure.ac @@ -100,12 +100,15 @@ AC_CANONICAL_TARGET MAGICK_TARGET_CPU=$host_cpu AC_SUBST(MAGICK_TARGET_CPU) +AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU]) MAGICK_TARGET_VENDOR=$host_vendor AC_SUBST(MAGICK_TARGET_VENDOR) +AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor]) MAGICK_TARGET_OS=$host_os AC_SUBST(MAGICK_TARGET_OS) +AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS]) # Substitute library versioning AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl