Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:netmax:distribution:CentOS_5
ImageMagick
ImageMagick-6.2.3-quantum-memory.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ImageMagick-6.2.3-quantum-memory.patch of Package ImageMagick
diff -r afaa74b998a6 magick/memory.c --- a/magick/memory.c Fri Sep 28 03:44:24 2007 -0800 +++ b/magick/memory.c Fri Sep 28 03:47:01 2007 -0800 @@ -356,6 +356,48 @@ MagickExport void *AcquireMagickMemory(c return(memory); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% A c q u i r e Q u a n t u m M e m o r y % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% AcquireQuantumMemory() returns a pointer to a block of memory at least +% count * quantum bytes suitably aligned for any use. +% +% The format of the AcquireQuantumMemory method is: +% +% void *AcquireQuantumMemory(const size_t count,const size_t quantum) +% +% A description of each parameter follows: +% +% o count: The number of quantum elements to allocate. +% +% o quantum: The number of bytes in each quantum. +% +*/ +MagickExport void *AcquireQuantumMemory(const size_t count,const size_t quantum) +{ + size_t + size; + + size=count*quantum; + if ((count == 0) || (quantum != (size/count))) + { + errno=ENOMEM; + return((void *) NULL); + } + return(AcquireMagickMemory(size)); +} + + + /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -698,3 +740,47 @@ MagickExport void *ResizeMagickMemory(vo memory=RelinquishMagickMemory(memory); return(block); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% R e s i z e Q u a n t u m M e m o r y % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResizeQuantumMemory() changes the size of the memory and returns a pointer +% to the (possibly moved) block. The contents will be unchanged up to the +% lesser of the new and old sizes. +% +% The format of the ResizeQuantumMemory method is: +% +% void *ResizeQuantumMemory(void *memory,const size_t count, +% const size_t quantum) +% +% A description of each parameter follows: +% +% o memory: A pointer to a memory allocation. +% +% o count: The number of quantum elements to allocate. +% +% o quantum: The number of bytes in each quantum. +% +*/ +MagickExport void *ResizeQuantumMemory(void *memory,const size_t count, + const size_t quantum) +{ + size_t + size; + + size=count*quantum; + if ((count == 0) || (quantum != (size/count))) + { + errno=ENOMEM; + return((void *) NULL); + } + return(ResizeMagickMemory(memory,size)); +} --- ImageMagick-6.2.8.orig/magick/memory_.h 2005-12-31 15:49:43.000000000 +1000 +++ ImageMagick-6.2.8/magick/memory_.h 2008-03-28 20:57:30.000000000 +1000 @@ -24,10 +24,12 @@ extern "C" { extern MagickExport void *AcquireMagickMemory(const size_t), + *AcquireQuantumMemory(const size_t,const size_t), *CopyMagickMemory(void *,const void *,const size_t), DestroyMagickMemory(void), *RelinquishMagickMemory(void *), *ResetMagickMemory(void *,int,const size_t), + *ResizeQuantumMemory(void *,const size_t,const size_t), *ResizeMagickMemory(void *,const size_t); #if defined(__cplusplus) || defined(c_plusplus)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor