From: cristy Date: Fri, 27 Jul 2012 01:41:20 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5239 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=568c2d479b431dcdd0250de860049ab3751809a0;p=imagemagick --- diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h index cbfdc8806..4545b8f2f 100644 --- a/MagickCore/magick-config.h +++ b/MagickCore/magick-config.h @@ -1139,6 +1139,9 @@ #define MAGICKCORE_HAVE_XLOCALE_H 1 #endif +/* Define to 1 if you have the `_aligned_malloc' function. */ +/* #undef HAVE__ALIGNED_MALLOC */ + /* Define to 1 if the system has the type `_Bool'. */ #ifndef MAGICKCORE_HAVE__BOOL #define MAGICKCORE_HAVE__BOOL 1 diff --git a/MagickCore/memory.c b/MagickCore/memory.c index b29ea0f35..4b6f01ef1 100644 --- a/MagickCore/memory.c +++ b/MagickCore/memory.c @@ -189,24 +189,44 @@ static MagickBooleanType MagickExport void *AcquireAlignedMemory(const size_t count,const size_t quantum) { size_t + alignment, + extent, size; + void + *memory; + size=count*quantum; if ((count == 0) || (quantum != (size/count))) { errno=ENOMEM; return((void *) NULL); } + memory=NULL; + alignment=CACHE_LINE_SIZE; + extent=(size+alignment-1)+sizeof(void *); + if ((size == 0) || (alignment < sizeof(void *)) || (extent <= size)) + return((void *) NULL); #if defined(MAGICKCORE_HAVE_POSIX_MEMALIGN) + if (posix_memalign(&memory,alignment,size) != 0) + memory=NULL; +#elif defined(MAGICKCORE_HAVE__ALIGNED_MALLOC) + memory=_aligned_malloc(size,alignment); +#else { void - *memory; - - if (posix_memalign(&memory,CACHE_LINE_SIZE,CacheAlign(size)) == 0) - return(memory); + *p; + + p=malloc(extent); + if (p != NULL) + { + memory=(void *) (((size_t) p+sizeof(void *)+alignment-1) & + ~(alignment-1)); + *((void **) memory-1)=p; + } } #endif - return(malloc(CacheAlign(size))); + return(memory); } #if defined(MAGICKCORE_ZERO_CONFIGURATION_SUPPORT) @@ -711,8 +731,14 @@ MagickExport void *RelinquishAlignedMemory(void *memory) { if (memory == (void *) NULL) return((void *) NULL); +#if defined(MAGICKCORE_HAVE_POSIX_MEMALIGN) free(memory); - return((void *) NULL); +#elif defined(MAGICKCORE_HAVE__ALIGNED_MALLOC) + _aligned_free(memory); +#else + free(*((void **) memory-1)); +#endif + return(NULL); } /* diff --git a/MagickCore/version.h b/MagickCore/version.h index 32c7b2815..d07bb074b 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 "8720" +#define MagickSVNRevision "8726" #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-22" +#define MagickReleaseDate "2012-07-26" #define MagickChangeDate "20110801" #define MagickAuthoritativeURL "http://www.imagemagick.org" #if defined(MAGICKCORE_OPENMP_SUPPORT) diff --git a/Makefile.in b/Makefile.in index 0aa89c8f0..5125c28d5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -306,7 +306,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ac_func_fseeko.m4 \ $(top_srcdir)/m4/ax_cxx_namespaces.m4 \ $(top_srcdir)/m4/ax_gcc_archflag.m4 \ $(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \ - $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_opencl.m4 \ $(top_srcdir)/m4/ax_prefix_config_h.m4 \ $(top_srcdir)/m4/ax_prog_perl_version.m4 \ diff --git a/config/ImageMagick.rdf b/config/ImageMagick.rdf index fd2adb7d8..a0822097a 100644 --- a/config/ImageMagick.rdf +++ b/config/ImageMagick.rdf @@ -5,7 +5,7 @@ ImageMagick ImageMagick: convert, edit, and compose images. - 2012-07-22 + 2012-07-26 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-22 + 2012-07-26 7.0.0 -0 diff --git a/config/config.h.in b/config/config.h.in index 9ad92d0d6..314b78a3d 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -740,6 +740,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_XLOCALE_H +/* Define to 1 if you have the `_aligned_malloc' function. */ +#undef HAVE__ALIGNED_MALLOC + /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL diff --git a/config/configure.xml b/config/configure.xml index 19252744b..fa5516687 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -10,8 +10,8 @@ - - + + diff --git a/configure b/configure index 217802dcd..c2823cff6 100755 --- a/configure +++ b/configure @@ -3651,7 +3651,7 @@ 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=8720 +MAGICK_SVN_REVISION=8726 @@ -7968,6 +7968,62 @@ case ".$ac_cv_cflags_warn_all" in ;; esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 +$as_echo_n "checking for C compiler vendor... " >&6; } +if ${ax_cv_c_compiler_vendor+:} false; then : + $as_echo_n "(cached) " >&6 +else + # note: don't check for gcc first since some other compilers define __GNUC__ + vendors="intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__TURBOC__ + comeau: __COMO__ + cray: _CRAYC + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + portland: __PGI + unknown: UNKNOWN" + for ventest in $vendors; do + case $ventest in + *:) vendor=$ventest; continue ;; + *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + #if !($vencpp) + thisisanerror; + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done + ax_cv_c_compiler_vendor=`echo $vendor | cut -d: -f1` + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 +$as_echo "$ax_cv_c_compiler_vendor" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } @@ -8622,36 +8678,6 @@ fi # -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5 -$as_echo_n "checking whether we are using the Microsoft C compiler... " >&6; } -if ${ax_cv_c_compiler_ms+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef _MSC_VER - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_compiler_ms=yes -else - ax_compiler_ms=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ax_cv_c_compiler_ms=$ax_compiler_ms - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_ms" >&5 -$as_echo "$ax_cv_c_compiler_ms" >&6; } GDI32_LIBS='' native_win32_build='no' @@ -9717,36 +9743,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5 -$as_echo_n "checking whether we are using the Microsoft C compiler... " >&6; } -if ${ax_cv_c_compiler_ms+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef _MSC_VER - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ax_compiler_ms=yes -else - ax_compiler_ms=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ax_cv_c_compiler_ms=$ax_compiler_ms - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_ms" >&5 -$as_echo "$ax_cv_c_compiler_ms" >&6; } + AX_LANG_COMPILER_MS if test X$ax_compiler_ms = Xno; then : CL_CFLAGS="${PTHREAD_CFLAGS}"; CL_LIBS="${PTHREAD_LIBS} -lm" fi @@ -25571,7 +25568,7 @@ fi LIBS="$MATH_LIBS $LIBS" -for ac_func in acosh asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat +for ac_func in acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 4c7cf837d..ebb09d009 100755 --- a/configure.ac +++ b/configure.ac @@ -13,6 +13,10 @@ # limitations under the License. # # Copyright (C) 2003 - 2008 GraphicsMagick Group +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. AC_PREREQ(2.67) @@ -257,6 +261,7 @@ AC_SUBST(LD) AC_PROG_CC_C99 AM_PROG_CC_C_O AX_CFLAGS_WARN_ALL +AX_COMPILER_VENDOR AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LN_S @@ -284,7 +289,6 @@ fi # AC_EXEEXT AC_OBJEXT -AX_LANG_COMPILER_MS GDI32_LIBS='' native_win32_build='no' @@ -1091,7 +1095,7 @@ AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,) LIBS="$MATH_LIBS $LIBS" AC_SUBST(MATH_LIBS) -AC_CHECK_FUNCS([acosh asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) +AC_CHECK_FUNCS([acosh _aligned_malloc asinh atanh atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r isnan j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) # # Check for clock_gettime(). diff --git a/m4/ax_lang_compiler_ms.m4 b/m4/ax_lang_compiler_ms.m4 deleted file mode 100644 index 658ca85e3..000000000 --- a/m4/ax_lang_compiler_ms.m4 +++ /dev/null @@ -1,37 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_lang_compiler_ms.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_LANG_COMPILER_MS -# -# DESCRIPTION -# -# Check whether the compiler for the current language is Microsoft. -# -# This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU Autoconf -# implementation. -# -# LICENSE -# -# Copyright (c) 2009 Braden McDaniel -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 8 - -AC_DEFUN([AX_LANG_COMPILER_MS], -[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler], - [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms], -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER - choke me -#endif -]])], - [ax_compiler_ms=yes], - [ax_compiler_ms=no]) -ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms -])])