From: cristy Date: Sat, 12 Dec 2009 20:48:33 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~10271 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90823213d62b0ba18557e61f1e6892c6fffd6cd4;p=imagemagick --- diff --git a/coders/djvu.c b/coders/djvu.c index 424618dda..7b31ff16f 100644 --- a/coders/djvu.c +++ b/coders/djvu.c @@ -794,7 +794,7 @@ static Image *ReadDJVUImage(const ImageInfo *image_info, /* * Allocate a LoadContext structure. */ - lc = (LoadContext *) AcquireMagickMemory(sizeof(*lc)); + lc = (LoadContext *) AcquireAlignedMemory(1,sizeof(*lc)); if (lc == NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); diff --git a/coders/gif.c b/coders/gif.c index 8dde617c3..bc65fab07 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -194,7 +194,7 @@ static LZWInfo *AcquireLZWInfo(Image *image,const unsigned long data_size) register long i; - lzw_info=(LZWInfo *) AcquireMagickMemory(sizeof(*lzw_info)); + lzw_info=(LZWInfo *) AcquireAlignedMemory(1,sizeof(*lzw_info)); if (lzw_info == (LZWInfo *) NULL) return((LZWInfo *) NULL); (void) ResetMagickMemory(lzw_info,0,sizeof(*lzw_info)); @@ -225,7 +225,7 @@ static LZWInfo *AcquireLZWInfo(Image *image,const unsigned long data_size) lzw_info->code_info.bit=8*lzw_info->code_info.count; lzw_info->code_info.eof=MagickFalse; lzw_info->genesis=MagickTrue; - lzw_info->stack=(LZWStack *) AcquireMagickMemory(sizeof(*lzw_info->stack)); + lzw_info->stack=(LZWStack *) AcquireAlignedMemory(1,sizeof(*lzw_info->stack)); if (lzw_info->stack == (LZWStack *) NULL) { lzw_info=RelinquishLZWInfo(lzw_info); diff --git a/coders/msl.c b/coders/msl.c index e8dc984c2..d2346db29 100644 --- a/coders/msl.c +++ b/coders/msl.c @@ -7590,7 +7590,7 @@ static MagickBooleanType ProcessMSLScript(const ImageInfo *image_info,Image **im msl_info.draw_info=(DrawInfo **) AcquireMagickMemory( sizeof(*msl_info.draw_info)); /* top of the stack is the MSL file itself */ - msl_info.image=(Image **) AcquireMagickMemory(sizeof(*msl_info.image)); + msl_info.image=(Image **) AcquireAlignedMemory(1,sizeof(*msl_info.image)); msl_info.attributes=(Image **) AcquireMagickMemory( sizeof(*msl_info.attributes)); msl_info.group_info=(MSLGroupInfo *) AcquireMagickMemory( diff --git a/coders/png.c b/coders/png.c index 11f34e146..69ed1d96a 100644 --- a/coders/png.c +++ b/coders/png.c @@ -2801,7 +2801,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, create a new object buffer. */ mng_info->ob[object_id]=(MngBuffer *) - AcquireMagickMemory(sizeof(MngBuffer)); + AcquireAlignedMemory(1,sizeof(MngBuffer)); if (mng_info->ob[object_id] != (MngBuffer *) NULL) { mng_info->ob[object_id]->image=(Image *) NULL; @@ -2944,7 +2944,7 @@ static Image *ReadPNGImage(const ImageInfo *image_info,ExceptionInfo *exception) Allocate a MngInfo structure. */ have_mng_structure=MagickFalse; - mng_info=(MngInfo *) AcquireMagickMemory(sizeof(MngInfo)); + mng_info=(MngInfo *) AcquireAlignedMemory(1,sizeof(MngInfo)); if (mng_info == (MngInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); /* @@ -3241,7 +3241,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, open alpha_blob, attached to alpha_image */ - color_image_info=(ImageInfo *)AcquireMagickMemory(sizeof(ImageInfo)); + color_image_info=(ImageInfo *)AcquireAlignedMemory(1,sizeof(ImageInfo)); if (color_image_info == (ImageInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); GetImageInfo(color_image_info); @@ -3261,7 +3261,7 @@ static Image *ReadOneJNGImage(MngInfo *mng_info, if ((image_info->ping == MagickFalse) && (jng_color_type >= 12)) { alpha_image_info=(ImageInfo *) - AcquireMagickMemory(sizeof(ImageInfo)); + AcquireAlignedMemory(1,sizeof(ImageInfo)); if (alpha_image_info == (ImageInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); GetImageInfo(alpha_image_info); @@ -3709,7 +3709,7 @@ static Image *ReadJNGImage(const ImageInfo *image_info,ExceptionInfo *exception) Allocate a MngInfo structure. */ have_mng_structure=MagickFalse; - mng_info=(MngInfo *) AcquireMagickMemory(sizeof(*mng_info)); + mng_info=(MngInfo *) AcquireAlignedMemory(1,sizeof(*mng_info)); if (mng_info == (MngInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); /* @@ -3881,7 +3881,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Allocate a MngInfo structure. */ - mng_info=(MngInfo *) AcquireMagickMemory(sizeof(MngInfo)); + mng_info=(MngInfo *) AcquireAlignedMemory(1,sizeof(MngInfo)); if (mng_info == (MngInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); /* @@ -7981,7 +7981,7 @@ static MagickBooleanType WritePNGImage(const ImageInfo *image_info, Allocate a MngInfo structure. */ have_mng_structure=MagickFalse; - mng_info=(MngInfo *) AcquireMagickMemory(sizeof(MngInfo)); + mng_info=(MngInfo *) AcquireAlignedMemory(1,sizeof(MngInfo)); if (mng_info == (MngInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); /* @@ -8629,7 +8629,7 @@ static MagickBooleanType WriteJNGImage(const ImageInfo *image_info,Image *image) Allocate a MngInfo structure. */ have_mng_structure=MagickFalse; - mng_info=(MngInfo *) AcquireMagickMemory(sizeof(MngInfo)); + mng_info=(MngInfo *) AcquireAlignedMemory(1,sizeof(MngInfo)); if (mng_info == (MngInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); /* @@ -8725,7 +8725,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image) Allocate a MngInfo structure. */ have_mng_structure=MagickFalse; - mng_info=(MngInfo *) AcquireMagickMemory(sizeof(MngInfo)); + mng_info=(MngInfo *) AcquireAlignedMemory(1,sizeof(MngInfo)); if (mng_info == (MngInfo *) NULL) ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); /* diff --git a/coders/svg.c b/coders/svg.c index 413d5afe0..eb9224fb0 100644 --- a/coders/svg.c +++ b/coders/svg.c @@ -259,12 +259,12 @@ static SVGInfo *AcquireSVGInfo(void) SVGInfo *svg_info; - svg_info=(SVGInfo *) AcquireMagickMemory(sizeof(*svg_info)); + svg_info=(SVGInfo *) AcquireAlignedMemory(1,sizeof(*svg_info)); if (svg_info == (SVGInfo *) NULL) return((SVGInfo *) NULL); (void) ResetMagickMemory(svg_info,0,sizeof(*svg_info)); svg_info->text=AcquireString(""); - svg_info->scale=(double *) AcquireMagickMemory(sizeof(*svg_info->scale)); + svg_info->scale=(double *) AcquireAlignedMemory(1,sizeof(*svg_info->scale)); if (svg_info->scale == (double *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetAffineMatrix(&svg_info->affine); diff --git a/coders/vid.c b/coders/vid.c index 68cd0d050..60a62ee8e 100644 --- a/coders/vid.c +++ b/coders/vid.c @@ -139,7 +139,7 @@ static Image *ReadVIDImage(const ImageInfo *image_info,ExceptionInfo *exception) assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); image=AcquireImage(image_info); - filelist=(char **) AcquireMagickMemory(sizeof(*filelist)); + filelist=(char **) AcquireAlignedMemory(1,sizeof(*filelist)); if (filelist == (char **) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); filelist[0]=ConstantString(image_info->filename); diff --git a/coders/xwd.c b/coders/xwd.c index b8deaf4c9..6d53ba36b 100644 --- a/coders/xwd.c +++ b/coders/xwd.c @@ -255,7 +255,7 @@ static Image *ReadXWDImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Initialize the X image. */ - ximage=(XImage *) AcquireMagickMemory(sizeof(*ximage)); + ximage=(XImage *) AcquireAlignedMemory(1,sizeof(*ximage)); if (ximage == (XImage *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); ximage->depth=(int) header.pixmap_depth; diff --git a/config/configure.xml b/config/configure.xml index 68723960d..fcc0c88dc 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -9,7 +9,7 @@ - + diff --git a/magick/PreRvIcccm.c b/magick/PreRvIcccm.c index 034cef5cc..2b0a2b554 100644 --- a/magick/PreRvIcccm.c +++ b/magick/PreRvIcccm.c @@ -127,17 +127,17 @@ Bool XSupportsLocale() */ XClassHint *XAllocClassHint) { - return((XClassHint *) AcquireMagickMemory(sizeof(XClassHint))); + return((XClassHint *) AcquireAlignedMemory(1,sizeof(XClassHint))); } XIconSize *XAllocIconSize) { - return((XIconSize *) AcquireMagickMemory(sizeof(XIconSize))); + return((XIconSize *) AcquireAlignedMemory(1,sizeof(XIconSize))); } XSizeHints *XAllocSizeHints) { - return((XSizeHints *) AcquireMagickMemory(sizeof(XSizeHints))); + return((XSizeHints *) AcquireAlignedMemory(1,sizeof(XSizeHints))); } Status XReconfigureWMWindow(Display *display,Window window,int screen_number, @@ -148,12 +148,12 @@ Status XReconfigureWMWindow(Display *display,Window window,int screen_number, XStandardColormap *XAllocStandardColormap) { - return((XStandardColormap *) AcquireMagickMemory(sizeof(XStandardColormap))); + return((XStandardColormap *) AcquireAlignedMemory(1,sizeof(XStandardColormap))); } XWMHints *XAllocWMHints) { - return((XWMHints *) AcquireMagickMemory(sizeof(XWMHints))); + return((XWMHints *) AcquireAlignedMemory(1,sizeof(XWMHints))); } Status XGetGCValues(Display *display,GC gc,unsigned long mask, diff --git a/magick/animate.c b/magick/animate.c index ee74d5b78..031d7ea10 100644 --- a/magick/animate.c +++ b/magick/animate.c @@ -413,7 +413,7 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, /* Expand the filenames. */ - filelist=(char **) AcquireMagickMemory(sizeof(char *)); + filelist=(char **) AcquireAlignedMemory(1,sizeof(char *)); if (filelist == (char **) NULL) { ThrowXWindowException(ResourceLimitError,"MemoryAllocationFailed", diff --git a/magick/blob.c b/magick/blob.c index 8ba3c3563..3d6065733 100644 --- a/magick/blob.c +++ b/magick/blob.c @@ -415,7 +415,7 @@ MagickExport BlobInfo *CloneBlobInfo(const BlobInfo *blob_info) BlobInfo *clone_info; - clone_info=(BlobInfo *) AcquireMagickMemory(sizeof(*clone_info)); + clone_info=(BlobInfo *) AcquireAlignedMemory(1,sizeof(*clone_info)); if (clone_info == (BlobInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetBlobInfo(clone_info); diff --git a/magick/cipher.c b/magick/cipher.c index 8c9f7e6d9..f1ad73cad 100644 --- a/magick/cipher.c +++ b/magick/cipher.c @@ -190,7 +190,7 @@ static AESInfo *AcquireAESInfo(void) AESInfo *aes_info; - aes_info=(AESInfo *) AcquireMagickMemory(sizeof(*aes_info)); + aes_info=(AESInfo *) AcquireAlignedMemory(1,sizeof(*aes_info)); if (aes_info == (AESInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(aes_info,0,sizeof(*aes_info)); diff --git a/magick/coder.c b/magick/coder.c index df81b6e0a..d7b2a85e4 100644 --- a/magick/coder.c +++ b/magick/coder.c @@ -780,7 +780,7 @@ static MagickBooleanType LoadCoderList(const char *xml,const char *filename, /* Coder element. */ - coder_info=(CoderInfo *) AcquireMagickMemory(sizeof(*coder_info)); + coder_info=(CoderInfo *) AcquireAlignedMemory(1,sizeof(*coder_info)); if (coder_info == (CoderInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(coder_info,0,sizeof(*coder_info)); @@ -911,7 +911,7 @@ static MagickBooleanType LoadCoderLists(const char *filename, *p; p=CoderMap+i; - coder_info=(CoderInfo *) AcquireMagickMemory(sizeof(*coder_info)); + coder_info=(CoderInfo *) AcquireAlignedMemory(1,sizeof(*coder_info)); if (coder_info == (CoderInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/magick/color.c b/magick/color.c index c1ad4e90e..76fc71b0d 100644 --- a/magick/color.c +++ b/magick/color.c @@ -2035,7 +2035,7 @@ static MagickBooleanType LoadColorList(const char *xml,const char *filename, /* Color element. */ - color_info=(ColorInfo *) AcquireMagickMemory(sizeof(*color_info)); + color_info=(ColorInfo *) AcquireAlignedMemory(1,sizeof(*color_info)); if (color_info == (ColorInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(color_info,0,sizeof(*color_info)); @@ -2183,7 +2183,7 @@ static MagickBooleanType LoadColorLists(const char *filename, *p; p=ColorMap+i; - color_info=(ColorInfo *) AcquireMagickMemory(sizeof(*color_info)); + color_info=(ColorInfo *) AcquireAlignedMemory(1,sizeof(*color_info)); if (color_info == (ColorInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/magick/compress.c b/magick/compress.c index 60fa115de..07b84220d 100644 --- a/magick/compress.c +++ b/magick/compress.c @@ -274,7 +274,7 @@ MagickExport void Ascii85Initialize(Image *image) Allocate image structure. */ if (image->ascii85 == (Ascii85Info *) NULL) - image->ascii85=(Ascii85Info *) AcquireMagickMemory(sizeof(*image->ascii85)); + image->ascii85=(Ascii85Info *) AcquireAlignedMemory(1,sizeof(*image->ascii85)); if (image->ascii85 == (Ascii85Info *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(image->ascii85,0,sizeof(*image->ascii85)); diff --git a/magick/deprecate.c b/magick/deprecate.c index 0b90a30df..ece228f81 100644 --- a/magick/deprecate.c +++ b/magick/deprecate.c @@ -2339,7 +2339,7 @@ MagickExport const ImageAttribute *GetImageAttribute(const Image *image, if (attribute != (const ImageAttribute *) NULL) return(attribute); } - attribute=(ImageAttribute *) AcquireMagickMemory(sizeof(*attribute)); + attribute=(ImageAttribute *) AcquireAlignedMemory(1,sizeof(*attribute)); if (attribute == (ImageAttribute *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(attribute,0,sizeof(*attribute)); diff --git a/magick/display.c b/magick/display.c index 7bc1af7f5..7bb046320 100644 --- a/magick/display.c +++ b/magick/display.c @@ -2233,7 +2233,7 @@ static MagickBooleanType XAnnotateEditImage(Display *display, /* Initialize annotate structure. */ - annotate_info=(XAnnotateInfo *) AcquireMagickMemory(sizeof(*annotate_info)); + annotate_info=(XAnnotateInfo *) AcquireAlignedMemory(1,sizeof(*annotate_info)); if (annotate_info == (XAnnotateInfo *) NULL) return(MagickFalse); XGetAnnotateInfo(annotate_info); @@ -13421,7 +13421,7 @@ static Image *XVisualDirectoryImage(Display *display, /* Expand the filenames. */ - filelist=(char **) AcquireMagickMemory(sizeof(*filelist)); + filelist=(char **) AcquireAlignedMemory(1,sizeof(*filelist)); if (filelist == (char **) NULL) { ThrowXWindowFatalException(ResourceLimitError,"MemoryAllocationFailed", diff --git a/magick/draw.c b/magick/draw.c index ae5ccebd2..9458ea4f0 100644 --- a/magick/draw.c +++ b/magick/draw.c @@ -196,7 +196,7 @@ MagickExport DrawInfo *AcquireDrawInfo(void) DrawInfo *draw_info; - draw_info=(DrawInfo *) AcquireMagickMemory(sizeof(*draw_info)); + draw_info=(DrawInfo *) AcquireAlignedMemory(1,sizeof(*draw_info)); if (draw_info == (DrawInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetDrawInfo((ImageInfo *) NULL,draw_info); @@ -236,7 +236,7 @@ MagickExport DrawInfo *CloneDrawInfo(const ImageInfo *image_info, DrawInfo *clone_info; - clone_info=(DrawInfo *) AcquireMagickMemory(sizeof(*clone_info)); + clone_info=(DrawInfo *) AcquireAlignedMemory(1,sizeof(*clone_info)); if (clone_info == (DrawInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetDrawInfo(image_info,clone_info); @@ -478,7 +478,7 @@ static PolygonInfo *ConvertPathToPolygon( /* Convert a path to the more efficient sorted rendering form. */ - polygon_info=(PolygonInfo *) AcquireMagickMemory(sizeof(*polygon_info)); + polygon_info=(PolygonInfo *) AcquireAlignedMemory(1,sizeof(*polygon_info)); if (polygon_info == (PolygonInfo *) NULL) return((PolygonInfo *) NULL); number_edges=16; @@ -1764,7 +1764,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) /* Allocate primitive info memory. */ - graphic_context=(DrawInfo **) AcquireMagickMemory(sizeof(*graphic_context)); + graphic_context=(DrawInfo **) AcquireAlignedMemory(1,sizeof(*graphic_context)); if (graphic_context == (DrawInfo **) NULL) { primitive=DestroyString(primitive); diff --git a/magick/exception.c b/magick/exception.c index 9be7f685d..0e46466c8 100644 --- a/magick/exception.c +++ b/magick/exception.c @@ -103,7 +103,7 @@ MagickExport ExceptionInfo *AcquireExceptionInfo(void) ExceptionInfo *exception; - exception=(ExceptionInfo *) AcquireMagickMemory(sizeof(*exception)); + exception=(ExceptionInfo *) AcquireAlignedMemory(1,sizeof(*exception)); if (exception == (ExceptionInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetExceptionInfo(exception); @@ -875,7 +875,7 @@ MagickExport MagickBooleanType ThrowException(ExceptionInfo *exception, (LocaleCompare(exception->reason,reason) == 0) && (LocaleCompare(exception->description,description) == 0)) return(MagickTrue); - p=(ExceptionInfo *) AcquireMagickMemory(sizeof(*p)); + p=(ExceptionInfo *) AcquireAlignedMemory(1,sizeof(*p)); if (p == (ExceptionInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(p,0,sizeof(*p)); diff --git a/magick/fx.c b/magick/fx.c index fbe60f6fc..4cf177822 100644 --- a/magick/fx.c +++ b/magick/fx.c @@ -158,7 +158,7 @@ MagickExport FxInfo *AcquireFxInfo(const Image *image,const char *expression) register long i; - fx_info=(FxInfo *) AcquireMagickMemory(sizeof(*fx_info)); + fx_info=(FxInfo *) AcquireAlignedMemory(1,sizeof(*fx_info)); if (fx_info == (FxInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(fx_info,0,sizeof(*fx_info)); diff --git a/magick/hashmap.c b/magick/hashmap.c index 690ab76b7..db4d8e9a5 100644 --- a/magick/hashmap.c +++ b/magick/hashmap.c @@ -165,7 +165,7 @@ MagickExport MagickBooleanType AppendValueToLinkedList( (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); if (list_info->elements == list_info->capacity) return(MagickFalse); - next=(ElementInfo *) AcquireMagickMemory(sizeof(*next)); + next=(ElementInfo *) AcquireAlignedMemory(1,sizeof(*next)); if (next == (ElementInfo *) NULL) return(MagickFalse); next->value=(void *) value; @@ -1035,7 +1035,7 @@ MagickExport MagickBooleanType InsertValueInLinkedList( if ((index > list_info->elements) || (list_info->elements == list_info->capacity)) return(MagickFalse); - next=(ElementInfo *) AcquireMagickMemory(sizeof(*next)); + next=(ElementInfo *) AcquireAlignedMemory(1,sizeof(*next)); if (next == (ElementInfo *) NULL) return(MagickFalse); next->value=(void *) value; @@ -1142,7 +1142,7 @@ MagickExport MagickBooleanType InsertValueInSortedLinkedList( return(MagickFalse); if (list_info->elements == list_info->capacity) return(MagickFalse); - next=(ElementInfo *) AcquireMagickMemory(sizeof(*next)); + next=(ElementInfo *) AcquireAlignedMemory(1,sizeof(*next)); if (next == (ElementInfo *) NULL) return(MagickFalse); next->value=(void *) value; @@ -1350,7 +1350,7 @@ MagickExport HashmapInfo *NewHashmap(const unsigned long capacity, HashmapInfo *hashmap_info; - hashmap_info=(HashmapInfo *) AcquireMagickMemory(sizeof(*hashmap_info)); + hashmap_info=(HashmapInfo *) AcquireAlignedMemory(1,sizeof(*hashmap_info)); if (hashmap_info == (HashmapInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(hashmap_info,0,sizeof(*hashmap_info)); @@ -1406,7 +1406,7 @@ MagickExport LinkedListInfo *NewLinkedList(const unsigned long capacity) LinkedListInfo *list_info; - list_info=(LinkedListInfo *) AcquireMagickMemory(sizeof(*list_info)); + list_info=(LinkedListInfo *) AcquireAlignedMemory(1,sizeof(*list_info)); if (list_info == (LinkedListInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(list_info,0,sizeof(*list_info)); @@ -1551,7 +1551,7 @@ MagickExport MagickBooleanType PutEntryInHashmap(HashmapInfo *hashmap_info, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); if ((key == (void *) NULL) || (value == (void *) NULL)) return(MagickFalse); - next=(EntryInfo *) AcquireMagickMemory(sizeof(*next)); + next=(EntryInfo *) AcquireAlignedMemory(1,sizeof(*next)); if (next == (EntryInfo *) NULL) return(MagickFalse); (void) LockSemaphoreInfo(hashmap_info->semaphore); diff --git a/magick/histogram.c b/magick/histogram.c index 853960601..94c198462 100644 --- a/magick/histogram.c +++ b/magick/histogram.c @@ -480,7 +480,7 @@ static CubeInfo *GetCubeInfo(void) /* Initialize tree to describe color cube. */ - cube_info=(CubeInfo *) AcquireMagickMemory(sizeof(*cube_info)); + cube_info=(CubeInfo *) AcquireAlignedMemory(1,sizeof(*cube_info)); if (cube_info == (CubeInfo *) NULL) return((CubeInfo *) NULL); (void) ResetMagickMemory(cube_info,0,sizeof(*cube_info)); @@ -591,7 +591,7 @@ static NodeInfo *GetNodeInfo(CubeInfo *cube_info,const unsigned long level) /* Allocate a new nodes of nodes. */ - nodes=(Nodes *) AcquireMagickMemory(sizeof(*nodes)); + nodes=(Nodes *) AcquireAlignedMemory(1,sizeof(*nodes)); if (nodes == (Nodes *) NULL) return((NodeInfo *) NULL); nodes->next=cube_info->node_queue; diff --git a/magick/image.c b/magick/image.c index 5a7692b7a..e2cbfaca0 100644 --- a/magick/image.c +++ b/magick/image.c @@ -153,7 +153,7 @@ MagickExport Image *AcquireImage(const ImageInfo *image_info) Allocate image structure. */ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); - image=(Image *) AcquireMagickMemory(sizeof(*image)); + image=(Image *) AcquireAlignedMemory(1,sizeof(*image)); if (image == (Image *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(image,0,sizeof(*image)); @@ -369,7 +369,7 @@ MagickExport ImageInfo *AcquireImageInfo(void) ImageInfo *image_info; - image_info=(ImageInfo *) AcquireMagickMemory(sizeof(*image_info)); + image_info=(ImageInfo *) AcquireAlignedMemory(1,sizeof(*image_info)); if (image_info == (ImageInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetImageInfo(image_info); @@ -820,7 +820,7 @@ MagickExport Image *CloneImage(const Image *image,const unsigned long columns, (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); - clone_image=(Image *) AcquireMagickMemory(sizeof(*clone_image)); + clone_image=(Image *) AcquireAlignedMemory(1,sizeof(*clone_image)); if (clone_image == (Image *) NULL) ThrowImageException(ResourceLimitError,"MemoryAllocationFailed"); (void) ResetMagickMemory(clone_image,0,sizeof(*clone_image)); diff --git a/magick/locale.c b/magick/locale.c index 25fa05e6b..d5c4fbae8 100644 --- a/magick/locale.c +++ b/magick/locale.c @@ -918,7 +918,7 @@ static MagickBooleanType LoadLocaleList(const char *xml,const char *filename, while ((isspace((int) ((unsigned char) *q)) != 0) && (q > p)) q--; (void) CopyMagickString(message,p,(size_t) (q-p+2)); - locale_info=(LocaleInfo *) AcquireMagickMemory(sizeof(*locale_info)); + locale_info=(LocaleInfo *) AcquireAlignedMemory(1,sizeof(*locale_info)); if (locale_info == (LocaleInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(locale_info,0,sizeof(*locale_info)); diff --git a/magick/log.c b/magick/log.c index cf8f2ee79..6b172494f 100644 --- a/magick/log.c +++ b/magick/log.c @@ -1378,7 +1378,7 @@ static MagickBooleanType LoadLogList(const char *xml,const char *filename, /* Allocate memory for the log list. */ - log_info=(LogInfo *) AcquireMagickMemory(sizeof(*log_info)); + log_info=(LogInfo *) AcquireAlignedMemory(1,sizeof(*log_info)); if (log_info == (LogInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(log_info,0,sizeof(*log_info)); @@ -1552,7 +1552,7 @@ static MagickBooleanType LoadLogLists(const char *filename, *p; p=LogMap+i; - log_info=(LogInfo *) AcquireMagickMemory(sizeof(*log_info)); + log_info=(LogInfo *) AcquireAlignedMemory(1,sizeof(*log_info)); if (log_info == (LogInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/magick/mac.c b/magick/mac.c index 71d039255..126753f41 100644 --- a/magick/mac.c +++ b/magick/mac.c @@ -1028,7 +1028,7 @@ MagickExport DIR *opendir(const char *path) errno=error; return((DIR *) NULL); } - entry=(DIR *) AcquireMagickMemory(sizeof(DIR)); + entry=(DIR *) AcquireAlignedMemory(1,sizeof(DIR)); if (entry == (DIR *) NULL) return((DIR *) NULL); entry->d_VRefNum=search_info.hFileInfo.ioVRefNum; diff --git a/magick/magic.c b/magick/magic.c index 415d51631..25b1bff24 100644 --- a/magick/magic.c +++ b/magick/magic.c @@ -762,7 +762,7 @@ static MagickBooleanType LoadMagicList(const char *xml,const char *filename, /* Magic element. */ - magic_info=(MagicInfo *) AcquireMagickMemory(sizeof(*magic_info)); + magic_info=(MagicInfo *) AcquireAlignedMemory(1,sizeof(*magic_info)); if (magic_info == (MagicInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(magic_info,0,sizeof(*magic_info)); @@ -954,7 +954,7 @@ static MagickBooleanType LoadMagicLists(const char *filename, *p; p=MagicMap+i; - magic_info=(MagicInfo *) AcquireMagickMemory(sizeof(*magic_info)); + magic_info=(MagicInfo *) AcquireAlignedMemory(1,sizeof(*magic_info)); if (magic_info == (MagicInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/magick/magick.c b/magick/magick.c index a4e0db9ef..fb5681f4c 100644 --- a/magick/magick.c +++ b/magick/magick.c @@ -1414,7 +1414,7 @@ MagickExport MagickInfo *SetMagickInfo(const char *name) assert(name != (const char *) NULL); (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",name); - magick_info=(MagickInfo *) AcquireMagickMemory(sizeof(*magick_info)); + magick_info=(MagickInfo *) AcquireAlignedMemory(1,sizeof(*magick_info)); if (magick_info == (MagickInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(magick_info,0,sizeof(*magick_info)); diff --git a/magick/mime.c b/magick/mime.c index c0b2b6a83..bb8a0a38b 100644 --- a/magick/mime.c +++ b/magick/mime.c @@ -814,7 +814,7 @@ static MagickBooleanType LoadMimeList(const char *xml,const char *filename, /* Process mime element. */ - mime_info=(MimeInfo *) AcquireMagickMemory(sizeof(*mime_info)); + mime_info=(MimeInfo *) AcquireAlignedMemory(1,sizeof(*mime_info)); if (mime_info == (MimeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(mime_info,0,sizeof(*mime_info)); diff --git a/magick/module.c b/magick/module.c index 6f049f952..35157b3d2 100644 --- a/magick/module.c +++ b/magick/module.c @@ -138,7 +138,7 @@ MagickExport ModuleInfo *AcquireModuleInfo(const char *path,const char *tag) ModuleInfo *module_info; - module_info=(ModuleInfo *) AcquireMagickMemory(sizeof(*module_info)); + module_info=(ModuleInfo *) AcquireAlignedMemory(1,sizeof(*module_info)); if (module_info == (ModuleInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(module_info,0,sizeof(*module_info)); @@ -447,7 +447,7 @@ MagickExport char **GetModuleList(const char *pattern, modules=(char **) RelinquishMagickMemory(modules); return((char **) NULL); } - buffer=(struct dirent *) AcquireMagickMemory(sizeof(*buffer)+FILENAME_MAX+1); + buffer=(struct dirent *) AcquireAlignedMemory(1,sizeof(*buffer)+FILENAME_MAX+1); if (buffer == (struct dirent *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); i=0; diff --git a/magick/montage.c b/magick/montage.c index 1884b57c4..5b8a92973 100644 --- a/magick/montage.c +++ b/magick/montage.c @@ -104,7 +104,7 @@ MagickExport MontageInfo *CloneMontageInfo(const ImageInfo *image_info, MontageInfo *clone_info; - clone_info=(MontageInfo *) AcquireMagickMemory(sizeof(*clone_info)); + clone_info=(MontageInfo *) AcquireAlignedMemory(1,sizeof(*clone_info)); if (clone_info == (MontageInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetMontageInfo(image_info,clone_info); diff --git a/magick/nt-base.c b/magick/nt-base.c index 4e1aa7dcd..799477069 100644 --- a/magick/nt-base.c +++ b/magick/nt-base.c @@ -1313,7 +1313,7 @@ MagickExport DIR *NTOpenDirectory(const char *path) MaxTextExtent); if (length >= MaxTextExtent) return((DIR *) NULL); - entry=(DIR *) AcquireMagickMemory(sizeof(DIR)); + entry=(DIR *) AcquireAlignedMemory(1,sizeof(DIR)); if (entry != (DIR *) NULL) { entry->firsttime=TRUE; diff --git a/magick/nt-feature.c b/magick/nt-feature.c index 7f1553949..0b6bda9e7 100644 --- a/magick/nt-feature.c +++ b/magick/nt-feature.c @@ -382,7 +382,7 @@ MagickExport MagickBooleanType NTLoadTypeLists(SplayTreeInfo *type_list, continue; *pos='\0'; /* Remove (TrueType) from string */ - type_info=(TypeInfo *) AcquireMagickMemory(sizeof(*type_info)); + type_info=(TypeInfo *) AcquireAlignedMemory(1,sizeof(*type_info)); if (type_info == (TypeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(type_info,0,sizeof(TypeInfo)); diff --git a/magick/pixel-private.h b/magick/pixel-private.h index 36e2cd0e6..a3a5ee6c4 100644 --- a/magick/pixel-private.h +++ b/magick/pixel-private.h @@ -34,7 +34,7 @@ static inline MagickPixelPacket *CloneMagickPixelPacket( MagickPixelPacket *clone_pixel; - clone_pixel=(MagickPixelPacket *) AcquireMagickMemory(sizeof(*clone_pixel)); + clone_pixel=(MagickPixelPacket *) AcquireAlignedMemory(1,sizeof(*clone_pixel)); if (clone_pixel == (MagickPixelPacket *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); *clone_pixel=(*pixel); diff --git a/magick/policy.c b/magick/policy.c index 0485af09e..02a2915ed 100644 --- a/magick/policy.c +++ b/magick/policy.c @@ -746,7 +746,7 @@ static MagickBooleanType LoadPolicyList(const char *xml,const char *filename, /* Policy element. */ - policy_info=(PolicyInfo *) AcquireMagickMemory(sizeof(*policy_info)); + policy_info=(PolicyInfo *) AcquireAlignedMemory(1,sizeof(*policy_info)); if (policy_info == (PolicyInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(policy_info,0,sizeof(*policy_info)); @@ -907,7 +907,7 @@ static MagickBooleanType LoadPolicyLists(const char *filename, *p; p=PolicyMap+i; - policy_info=(PolicyInfo *) AcquireMagickMemory(sizeof(*policy_info)); + policy_info=(PolicyInfo *) AcquireAlignedMemory(1,sizeof(*policy_info)); if (policy_info == (PolicyInfo *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), diff --git a/magick/quantize.c b/magick/quantize.c index 7b1510db3..97c243257 100644 --- a/magick/quantize.c +++ b/magick/quantize.c @@ -361,7 +361,7 @@ MagickExport QuantizeInfo *AcquireQuantizeInfo(const ImageInfo *image_info) QuantizeInfo *quantize_info; - quantize_info=(QuantizeInfo *) AcquireMagickMemory(sizeof(*quantize_info)); + quantize_info=(QuantizeInfo *) AcquireAlignedMemory(1,sizeof(*quantize_info)); if (quantize_info == (QuantizeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetQuantizeInfo(quantize_info); @@ -969,7 +969,7 @@ MagickExport QuantizeInfo *CloneQuantizeInfo(const QuantizeInfo *quantize_info) QuantizeInfo *clone_info; - clone_info=(QuantizeInfo *) AcquireMagickMemory(sizeof(*clone_info)); + clone_info=(QuantizeInfo *) AcquireAlignedMemory(1,sizeof(*clone_info)); if (clone_info == (QuantizeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); GetQuantizeInfo(clone_info); @@ -1842,7 +1842,7 @@ static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, /* Initialize tree to describe color cube_info. */ - cube_info=(CubeInfo *) AcquireMagickMemory(sizeof(*cube_info)); + cube_info=(CubeInfo *) AcquireAlignedMemory(1,sizeof(*cube_info)); if (cube_info == (CubeInfo *) NULL) return((CubeInfo *) NULL); (void) ResetMagickMemory(cube_info,0,sizeof(*cube_info)); @@ -1942,7 +1942,7 @@ static NodeInfo *GetNodeInfo(CubeInfo *cube_info,const unsigned long id, /* Allocate a new queue of nodes. */ - nodes=(Nodes *) AcquireMagickMemory(sizeof(*nodes)); + nodes=(Nodes *) AcquireAlignedMemory(1,sizeof(*nodes)); if (nodes == (Nodes *) NULL) return((NodeInfo *) NULL); nodes->nodes=(NodeInfo *) AcquireQuantumMemory(NodesInAList, diff --git a/magick/quantum.c b/magick/quantum.c index 3233728ef..32fedc5f6 100644 --- a/magick/quantum.c +++ b/magick/quantum.c @@ -119,7 +119,7 @@ MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info, QuantumInfo *quantum_info; - quantum_info=(QuantumInfo *) AcquireMagickMemory(sizeof(*quantum_info)); + quantum_info=(QuantumInfo *) AcquireAlignedMemory(1,sizeof(*quantum_info)); if (quantum_info == (QuantumInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); quantum_info->signature=MagickSignature; diff --git a/magick/registry.c b/magick/registry.c index 3f2480021..f74bbc8c4 100644 --- a/magick/registry.c +++ b/magick/registry.c @@ -514,7 +514,7 @@ MagickExport MagickBooleanType SetImageRegistry(const RegistryType type, } if (clone_value == (void *) NULL) return(MagickFalse); - registry_info=(RegistryInfo *) AcquireMagickMemory(sizeof(*registry_info)); + registry_info=(RegistryInfo *) AcquireAlignedMemory(1,sizeof(*registry_info)); if (registry_info == (RegistryInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(registry_info,0,sizeof(*registry_info)); diff --git a/magick/resize.c b/magick/resize.c index 4695d80c4..8f4d19fec 100644 --- a/magick/resize.c +++ b/magick/resize.c @@ -583,7 +583,7 @@ MagickExport ResizeFilter *AcquireResizeFilter(const Image *image, assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); - resize_filter=(ResizeFilter *) AcquireMagickMemory(sizeof(*resize_filter)); + resize_filter=(ResizeFilter *) AcquireAlignedMemory(1,sizeof(*resize_filter)); if (resize_filter == (ResizeFilter *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); diff --git a/magick/segment.c b/magick/segment.c index c42227e22..eea376f66 100644 --- a/magick/segment.c +++ b/magick/segment.c @@ -305,7 +305,7 @@ static MagickBooleanType Classify(Image *image,short **extrema, } else { - cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster)); + cluster=(Cluster *) AcquireAlignedMemory(1,sizeof(*cluster)); head=cluster; } if (cluster == (Cluster *) NULL) @@ -327,7 +327,7 @@ static MagickBooleanType Classify(Image *image,short **extrema, /* No classes were identified-- create one. */ - cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster)); + cluster=(Cluster *) AcquireAlignedMemory(1,sizeof(*cluster)); if (cluster == (Cluster *) NULL) ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); @@ -1035,7 +1035,7 @@ MagickExport MagickBooleanType GetImageDynamicThreshold(const Image *image, } else { - cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster)); + cluster=(Cluster *) AcquireAlignedMemory(1,sizeof(*cluster)); head=cluster; } if (cluster == (Cluster *) NULL) @@ -1061,7 +1061,7 @@ MagickExport MagickBooleanType GetImageDynamicThreshold(const Image *image, /* No classes were identified-- create one. */ - cluster=(Cluster *) AcquireMagickMemory(sizeof(*cluster)); + cluster=(Cluster *) AcquireAlignedMemory(1,sizeof(*cluster)); if (cluster == (Cluster *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(), @@ -1370,7 +1370,7 @@ static IntervalTree *InitializeIntervalTree(const ZeroCrossing *zero_crossing, /* The root is the entire histogram. */ - root=(IntervalTree *) AcquireMagickMemory(sizeof(*root)); + root=(IntervalTree *) AcquireAlignedMemory(1,sizeof(*root)); root->child=(IntervalTree *) NULL; root->sibling=(IntervalTree *) NULL; root->tau=0.0; diff --git a/magick/shear.c b/magick/shear.c index a3b1f12eb..705a26c85 100644 --- a/magick/shear.c +++ b/magick/shear.c @@ -368,7 +368,7 @@ static RadonInfo *AcquireRadonInfo(const Image *image,const unsigned long width, RadonInfo *radon_info; - radon_info=(RadonInfo *) AcquireMagickMemory(sizeof(*radon_info)); + radon_info=(RadonInfo *) AcquireAlignedMemory(1,sizeof(*radon_info)); if (radon_info == (RadonInfo *) NULL) return((RadonInfo *) NULL); (void) ResetMagickMemory(radon_info,0,sizeof(*radon_info)); diff --git a/magick/signature.c b/magick/signature.c index dd1a00763..9e957b4e2 100644 --- a/magick/signature.c +++ b/magick/signature.c @@ -120,7 +120,7 @@ MagickExport SignatureInfo *AcquireSignatureInfo(void) unsigned int lsb_first; - signature_info=(SignatureInfo *) AcquireMagickMemory(sizeof(*signature_info)); + signature_info=(SignatureInfo *) AcquireAlignedMemory(1,sizeof(*signature_info)); if (signature_info == (SignatureInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(signature_info,0,sizeof(*signature_info)); diff --git a/magick/splay-tree.c b/magick/splay-tree.c index 6b92d848c..94ef08859 100644 --- a/magick/splay-tree.c +++ b/magick/splay-tree.c @@ -182,7 +182,7 @@ MagickExport MagickBooleanType AddValueToSplayTree(SplayTreeInfo *splay_tree, return(MagickTrue); } } - node=(NodeInfo *) AcquireMagickMemory(sizeof(*node)); + node=(NodeInfo *) AcquireAlignedMemory(1,sizeof(*node)); if (node == (NodeInfo *) NULL) { (void) UnlockSemaphoreInfo(splay_tree->semaphore); @@ -1127,7 +1127,7 @@ MagickExport SplayTreeInfo *NewSplayTree( SplayTreeInfo *splay_tree; - splay_tree=(SplayTreeInfo *) AcquireMagickMemory(sizeof(*splay_tree)); + splay_tree=(SplayTreeInfo *) AcquireAlignedMemory(1,sizeof(*splay_tree)); if (splay_tree == (SplayTreeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(splay_tree,0,sizeof(*splay_tree)); diff --git a/magick/stream.c b/magick/stream.c index 4131154ee..5508bf26f 100644 --- a/magick/stream.c +++ b/magick/stream.c @@ -151,7 +151,7 @@ MagickExport StreamInfo *AcquireStreamInfo(const ImageInfo *image_info) StreamInfo *stream_info; - stream_info=(StreamInfo *) AcquireMagickMemory(sizeof(*stream_info)); + stream_info=(StreamInfo *) AcquireAlignedMemory(1,sizeof(*stream_info)); if (stream_info == (StreamInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(stream_info,0,sizeof(*stream_info)); diff --git a/magick/string.c b/magick/string.c index 6ff58855d..98df84853 100644 --- a/magick/string.c +++ b/magick/string.c @@ -157,7 +157,7 @@ MagickExport StringInfo *AcquireStringInfo(const size_t length) StringInfo *string_info; - string_info=(StringInfo *) AcquireMagickMemory(sizeof(*string_info)); + string_info=(StringInfo *) AcquireAlignedMemory(1,sizeof(*string_info)); if (string_info == (StringInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(string_info,0,sizeof(*string_info)); diff --git a/magick/thread.c b/magick/thread.c index 1514be3cb..6de531b56 100644 --- a/magick/thread.c +++ b/magick/thread.c @@ -69,7 +69,7 @@ MagickExport MagickBooleanType MagickCreateThreadKey(MagickThreadKey *key) *key=TlsAlloc(); return(*key != TLS_OUT_OF_INDEXES ? MagickTrue : MagickFalse); #else - *key=AcquireMagickMemory(sizeof(key)); + *key=AcquireAlignedMemory(1,sizeof(key)); return(*key != (void *) NULL ? MagickTrue : MagickFalse); #endif } diff --git a/magick/threshold.c b/magick/threshold.c index cf9497746..7f149eeb3 100644 --- a/magick/threshold.c +++ b/magick/threshold.c @@ -923,7 +923,7 @@ MagickExport ThresholdMap *GetThresholdMapFile(const char *xml, } /* The map has been found -- Allocate a Threshold Map to return */ - map = (ThresholdMap *)AcquireMagickMemory(sizeof(ThresholdMap)); + map = (ThresholdMap *)AcquireAlignedMemory(1,sizeof(ThresholdMap)); if ( map == (ThresholdMap *)NULL ) ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireThresholdMap"); map->map_id = (char *)NULL; diff --git a/magick/timer.c b/magick/timer.c index d003bbc2c..4adc2d23c 100644 --- a/magick/timer.c +++ b/magick/timer.c @@ -90,7 +90,7 @@ MagickExport TimerInfo *AcquireTimerInfo(void) TimerInfo *timer_info; - timer_info=(TimerInfo *) AcquireMagickMemory(sizeof(*timer_info)); + timer_info=(TimerInfo *) AcquireAlignedMemory(1,sizeof(*timer_info)); if (timer_info == (TimerInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"UnableToAcquireString"); (void) ResetMagickMemory(timer_info,0,sizeof(*timer_info)); diff --git a/magick/token.c b/magick/token.c index 2f443d548..c2fcc148a 100644 --- a/magick/token.c +++ b/magick/token.c @@ -94,7 +94,7 @@ MagickExport TokenInfo *AcquireTokenInfo(void) TokenInfo *token_info; - token_info=(TokenInfo *) AcquireMagickMemory(sizeof(*token_info)); + token_info=(TokenInfo *) AcquireAlignedMemory(1,sizeof(*token_info)); if (token_info == (TokenInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); token_info->signature=MagickSignature; diff --git a/magick/type.c b/magick/type.c index 1b097dc93..a79ed2469 100644 --- a/magick/type.c +++ b/magick/type.c @@ -694,7 +694,7 @@ MagickExport MagickBooleanType LoadFontConfigFonts(SplayTreeInfo *type_list, GetPathComponent((const char *) file,ExtensionPath,extension); if ((*extension != '\0') && (LocaleCompare(extension,"gz") == 0)) continue; - type_info=(TypeInfo *) AcquireMagickMemory(sizeof(*type_info)); + type_info=(TypeInfo *) AcquireAlignedMemory(1,sizeof(*type_info)); if (type_info == (TypeInfo *) NULL) continue; (void) ResetMagickMemory(type_info,0,sizeof(*type_info)); @@ -1062,7 +1062,7 @@ static MagickBooleanType LoadTypeList(const char *xml,const char *filename, /* Type element. */ - type_info=(TypeInfo *) AcquireMagickMemory(sizeof(*type_info)); + type_info=(TypeInfo *) AcquireAlignedMemory(1,sizeof(*type_info)); if (type_info == (TypeInfo *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); (void) ResetMagickMemory(type_info,0,sizeof(*type_info)); diff --git a/magick/utility.c b/magick/utility.c index 105d87130..c8963cdb1 100644 --- a/magick/utility.c +++ b/magick/utility.c @@ -1673,7 +1673,7 @@ MagickExport char **ListFiles(const char *directory,const char *pattern, /* Save the current and change to the new directory. */ - buffer=(struct dirent *) AcquireMagickMemory(sizeof(*buffer)+FILENAME_MAX+1); + buffer=(struct dirent *) AcquireAlignedMemory(1,sizeof(*buffer)+FILENAME_MAX+1); if (buffer == (struct dirent *) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); while ((MagickReadDirectory(current_directory,buffer,&entry) == 0) && diff --git a/magick/version.h b/magick/version.h index 976c74d05..470597e26 100644 --- a/magick/version.h +++ b/magick/version.h @@ -31,7 +31,7 @@ extern "C" { #define MagickLibVersionText "6.5.8" #define MagickLibVersionNumber 2,0,1 #define MagickLibSubversion "-6" -#define MagickReleaseDate "2009-12-11" +#define MagickReleaseDate "2009-12-12" #define MagickChangeDate "20091209" #define MagickAuthoritativeURL "http://www.imagemagick.org" #define MagickHomeURL "file:///usr/local/share/doc/ImageMagick-6.5.8/index.html" diff --git a/magick/vms.c b/magick/vms.c index d3c836feb..150e54444 100644 --- a/magick/vms.c +++ b/magick/vms.c @@ -111,7 +111,7 @@ DIR *opendir(char *name) /* Allocate memory for handle and the pattern. */ - directory=(DIR *) AcquireMagickMemory(sizeof(DIR)); + directory=(DIR *) AcquireAlignedMemory(1,sizeof(DIR)); if (directory == (DIR *) NULL) { errno=ENOMEM; diff --git a/magick/xml-tree.c b/magick/xml-tree.c index e8faf8f60..a9b6fd9eb 100644 --- a/magick/xml-tree.c +++ b/magick/xml-tree.c @@ -165,7 +165,7 @@ MagickExport XMLTreeInfo *AddChildToXMLTree(XMLTreeInfo *xml_info, if (xml_info == (XMLTreeInfo *) NULL) return((XMLTreeInfo *) NULL); - child=(XMLTreeInfo *) AcquireMagickMemory(sizeof(*child)); + child=(XMLTreeInfo *) AcquireAlignedMemory(1,sizeof(*child)); if (child == (XMLTreeInfo *) NULL) return((XMLTreeInfo *) NULL); (void) ResetMagickMemory(child,0,sizeof(*child)); @@ -1460,7 +1460,7 @@ static void ParseProcessingInstructions(XMLTreeRoot *root,char *xml, } if (root->processing_instructions[0] == (char **) NULL) { - root->processing_instructions=(char ***) AcquireMagickMemory(sizeof( + root->processing_instructions=(char ***) AcquireAlignedMemory(1,sizeof( *root->processing_instructions)); if (root->processing_instructions ==(char ***) NULL) ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed"); @@ -1526,7 +1526,7 @@ static MagickBooleanType ParseInternalDoctype(XMLTreeRoot *root,char *xml, i; n=(char *) NULL; - predefined_entitites=(char **) AcquireMagickMemory(sizeof(sentinel)); + predefined_entitites=(char **) AcquireAlignedMemory(1,sizeof(sentinel)); if (predefined_entitites == (char **) NULL) ThrowFatalException(ResourceLimitError,"MemoryAllocationFailed"); (void) CopyMagickMemory(predefined_entitites,sentinel,sizeof(sentinel)); @@ -2125,7 +2125,7 @@ MagickExport XMLTreeInfo *NewXMLTreeTag(const char *tag) XMLTreeRoot *root; - root=(XMLTreeRoot *) AcquireMagickMemory(sizeof(*root)); + root=(XMLTreeRoot *) AcquireAlignedMemory(1,sizeof(*root)); if (root == (XMLTreeRoot *) NULL) return((XMLTreeInfo *) NULL); (void) ResetMagickMemory(root,0,sizeof(*root)); @@ -2134,7 +2134,7 @@ MagickExport XMLTreeInfo *NewXMLTreeTag(const char *tag) root->root.tag=ConstantString(tag); root->node=(&root->root); root->root.content=ConstantString(""); - root->entities=(char **) AcquireMagickMemory(sizeof(predefined_entities)); + root->entities=(char **) AcquireAlignedMemory(1,sizeof(predefined_entities)); if (root->entities == (char **) NULL) return((XMLTreeInfo *) NULL); (void) CopyMagickMemory(root->entities,predefined_entities, diff --git a/magick/xwindow.c b/magick/xwindow.c index 7eb7dd876..a7b9aa60c 100644 --- a/magick/xwindow.c +++ b/magick/xwindow.c @@ -4291,7 +4291,7 @@ static Image *XGetWindowImage(Display *display,const Window window, /* Append colormap to colormap list. */ - p=(ColormapInfo *) AcquireMagickMemory(sizeof(*p)); + p=(ColormapInfo *) AcquireAlignedMemory(1,sizeof(*p)); if (p == (ColormapInfo *) NULL) return((Image *) NULL); p->colormap=window_info[id].colormap; @@ -5104,7 +5104,7 @@ MagickExport XWindows *XInitializeWindows(Display *display, /* Allocate windows structure. */ - windows=(XWindows *) AcquireMagickMemory(sizeof(*windows)); + windows=(XWindows *) AcquireAlignedMemory(1,sizeof(*windows)); if (windows == (XWindows *) NULL) { ThrowXWindowFatalException(XServerFatalError,"MemoryAllocationFailed", diff --git a/wand/deprecate.c b/wand/deprecate.c index cd0aa09b6..660c6a663 100644 --- a/wand/deprecate.c +++ b/wand/deprecate.c @@ -430,7 +430,7 @@ static MagickWand *CloneMagickWandFromImages(const MagickWand *wand, assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand)); + clone_wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*clone_wand)); if (clone_wand == (MagickWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", images->filename); diff --git a/wand/drawing-wand.c b/wand/drawing-wand.c index d66b57975..adb3b6f82 100644 --- a/wand/drawing-wand.c +++ b/wand/drawing-wand.c @@ -555,7 +555,7 @@ WandExport DrawingWand *CloneDrawingWand(const DrawingWand *wand) assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - clone_wand=(DrawingWand *) AcquireMagickMemory(sizeof(*clone_wand)); + clone_wand=(DrawingWand *) AcquireAlignedMemory(1,sizeof(*clone_wand)); if (clone_wand == (DrawingWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError, "MemoryAllocationFailed",GetExceptionMessage(errno)); @@ -6571,7 +6571,7 @@ WandExport DrawingWand *NewDrawingWand(void) quantum=GetMagickQuantumDepth(&depth); if (depth != MAGICKCORE_QUANTUM_DEPTH) ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum); - wand=(DrawingWand *) AcquireMagickMemory(sizeof(*wand)); + wand=(DrawingWand *) AcquireAlignedMemory(1,sizeof(*wand)); if (wand == (DrawingWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", GetExceptionMessage(errno)); @@ -6592,7 +6592,7 @@ WandExport DrawingWand *NewDrawingWand(void) wand->pattern_bounds.width=0; wand->pattern_bounds.height=0; wand->index=0; - wand->graphic_context=(DrawInfo **) AcquireMagickMemory(sizeof( + wand->graphic_context=(DrawInfo **) AcquireAlignedMemory(1,sizeof( *wand->graphic_context)); if (wand->graphic_context == (DrawInfo **) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", diff --git a/wand/magick-image.c b/wand/magick-image.c index 6af2a5bb6..91334d586 100644 --- a/wand/magick-image.c +++ b/wand/magick-image.c @@ -99,7 +99,7 @@ static MagickWand *CloneMagickWandFromImages(const MagickWand *wand, assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand)); + clone_wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*clone_wand)); if (clone_wand == (MagickWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", images->filename); diff --git a/wand/magick-wand.c b/wand/magick-wand.c index 81d26c40e..82f6ce8c7 100644 --- a/wand/magick-wand.c +++ b/wand/magick-wand.c @@ -129,7 +129,7 @@ WandExport MagickWand *CloneMagickWand(const MagickWand *wand) assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - clone_wand=(MagickWand *) AcquireMagickMemory(sizeof(*clone_wand)); + clone_wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*clone_wand)); if (clone_wand == (MagickWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", wand->name); @@ -1028,7 +1028,7 @@ WandExport MagickWand *NewMagickWand(void) quantum=GetMagickQuantumDepth(&depth); if (depth != MAGICKCORE_QUANTUM_DEPTH) ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum); - wand=(MagickWand *) AcquireMagickMemory(sizeof(*wand)); + wand=(MagickWand *) AcquireAlignedMemory(1,sizeof(*wand)); if (wand == (MagickWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", GetExceptionMessage(errno)); diff --git a/wand/pixel-iterator.c b/wand/pixel-iterator.c index 9d2d4b64b..e0f8cd159 100644 --- a/wand/pixel-iterator.c +++ b/wand/pixel-iterator.c @@ -162,7 +162,7 @@ WandExport PixelIterator *ClonePixelIterator(const PixelIterator *iterator) assert(iterator->signature == WandSignature); if (iterator->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",iterator->name); - clone_iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*clone_iterator)); + clone_iterator=(PixelIterator *) AcquireAlignedMemory(1,sizeof(*clone_iterator)); if (clone_iterator == (PixelIterator *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", iterator->name); @@ -312,7 +312,7 @@ WandExport PixelIterator *NewPixelIterator(MagickWand *wand) view=AcquireCacheView(image); if (view == (CacheView *) NULL) return((PixelIterator *) NULL); - iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator)); + iterator=(PixelIterator *) AcquireAlignedMemory(1,sizeof(*iterator)); if (iterator == (PixelIterator *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", GetExceptionMessage(errno)); @@ -427,7 +427,7 @@ WandExport PixelIterator *NewPixelRegionIterator(MagickWand *wand,const long x, view=AcquireCacheView(image); if (view == (CacheView *) NULL) return((PixelIterator *) NULL); - iterator=(PixelIterator *) AcquireMagickMemory(sizeof(*iterator)); + iterator=(PixelIterator *) AcquireAlignedMemory(1,sizeof(*iterator)); if (iterator == (PixelIterator *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", wand->name); diff --git a/wand/pixel-view.c b/wand/pixel-view.c index 98249369a..de049e790 100644 --- a/wand/pixel-view.c +++ b/wand/pixel-view.c @@ -127,7 +127,7 @@ WandExport PixelView *ClonePixelView(const PixelView *pixel_view) assert(pixel_view->signature == WandSignature); if (pixel_view->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",pixel_view->name); - clone_view=(PixelView *) AcquireMagickMemory(sizeof(*clone_view)); + clone_view=(PixelView *) AcquireAlignedMemory(1,sizeof(*clone_view)); if (clone_view == (PixelView *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", pixel_view->name); @@ -838,7 +838,7 @@ WandExport PixelView *NewPixelView(MagickWand *wand) assert(wand != (MagickWand *) NULL); assert(wand->signature == MagickSignature); - pixel_view=(PixelView *) AcquireMagickMemory(sizeof(*pixel_view)); + pixel_view=(PixelView *) AcquireAlignedMemory(1,sizeof(*pixel_view)); if (pixel_view == (PixelView *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", GetExceptionMessage(errno)); @@ -897,7 +897,7 @@ WandExport PixelView *NewPixelViewRegion(MagickWand *wand,const long x, assert(wand != (MagickWand *) NULL); assert(wand->signature == MagickSignature); - pixel_view=(PixelView *) AcquireMagickMemory(sizeof(*pixel_view)); + pixel_view=(PixelView *) AcquireAlignedMemory(1,sizeof(*pixel_view)); if (pixel_view == (PixelView *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", GetExceptionMessage(errno)); diff --git a/wand/pixel-wand.c b/wand/pixel-wand.c index 4d7b4f47c..af1d2612c 100644 --- a/wand/pixel-wand.c +++ b/wand/pixel-wand.c @@ -148,7 +148,7 @@ WandExport PixelWand *ClonePixelWand(const PixelWand *wand) assert(wand->signature == WandSignature); if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); - clone_wand=(PixelWand *) AcquireMagickMemory(sizeof(*clone_wand)); + clone_wand=(PixelWand *) AcquireAlignedMemory(1,sizeof(*clone_wand)); if (clone_wand == (PixelWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", wand->name); @@ -400,7 +400,7 @@ WandExport PixelWand *NewPixelWand(void) quantum=GetMagickQuantumDepth(&depth); if (depth != MAGICKCORE_QUANTUM_DEPTH) ThrowWandFatalException(WandError,"QuantumDepthMismatch",quantum); - wand=(PixelWand *) AcquireMagickMemory(sizeof(*wand)); + wand=(PixelWand *) AcquireAlignedMemory(1,sizeof(*wand)); if (wand == (PixelWand *) NULL) ThrowWandFatalException(ResourceLimitFatalError,"MemoryAllocationFailed", GetExceptionMessage(errno));