From: cristy Date: Sat, 22 Jun 2013 00:54:32 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~3564 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1a029000fa6ae3fe6290c4155bd8ecb0db0d4c3;p=imagemagick --- diff --git a/MagickCore/memory.c b/MagickCore/memory.c index 617129c44..c7cfaf0e3 100644 --- a/MagickCore/memory.c +++ b/MagickCore/memory.c @@ -125,7 +125,7 @@ typedef struct _MemoryInfo mapped; void - *memory; + *blob; size_t signature; @@ -472,21 +472,28 @@ MagickExport void *AcquireMagickMemory(const size_t size) % % % % % % -% A c q u i r e M e m o r y I n f o % +% A c q u i r e V i r t u a l M e m o r y % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% AcquireMemoryInfo() returns a MemoryInfo structure. This method always -% succeeds. +% AcquireVirtualMemory() allocates a pointer to a block of memory at least size +% bytes suitably aligned for any use. +% +% The format of the AcquireVirtualMemory method is: +% +% MemoryInfo *AcquireVirtualMemory(const size_t count,const size_t quantum) % -% The format of the AcquireMemoryInfo method is: +% A description of each parameter follows: +% +% o count: the number of quantum elements to allocate. % -% MemoryInfo *AcquireMemoryInfo(void) +% o quantum: the number of bytes in each quantum. % */ -MagickExport MemoryInfo *AcquireMemoryInfo(void) +MagickExport MemoryInfo *AcquireVirtualMemory(const size_t count, + const size_t quantum) { MemoryInfo *memory_info; @@ -762,34 +769,28 @@ MagickExport void GetMagickMemoryMethods( % % % % % % -% G e t M e m o r y I n f o M e m o r y % +% G e t V i r t u a l M e m o r y B l o b % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% GetMemoryInfoMemory() returns a pointer to a block of memory at least size -% bytes suitably aligned for any use. +% GetVirtualMemoryBlob() returns the virtual memory blob associated with the +% specified MemoryInfo structure. % -% The format of the GetMemoryInfoMemory method is: +% The format of the GetVirtualMemoryBlob method is: % -% void *GetMemoryInfoMemory(MemoryInfo *memory_info,const size_t count, -% const size_t quantum) +% void *GetVirtualMemoryBlob(const MemoryInfo *memory_info) % % A description of each parameter follows: % % o memory_info: The MemoryInfo structure. -% -% o count: the number of quantum elements to allocate. -% -% o quantum: the number of bytes in each quantum. */ -MagickExport void *GetMemoryInfoMemory(MemoryInfo *memory_info, - const size_t count,const size_t quantum) +MagickExport void *GetVirtualMemoryBlob(const MemoryInfo *memory_info) { assert(memory_info != (const MemoryInfo *) NULL); assert(memory_info->signature == MagickSignature); - return(memory_info->memory); + return(memory_info->blob); } /* @@ -902,30 +903,29 @@ MagickExport void *RelinquishMagickMemory(void *memory) % % % % % % -% R e l i n q u i s h M e m o r y I n f o % +% R e l i n q u i s h V i r t u a l M e m o r y % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% RelinquishMemoryInfo() destroys the MemoryInfo structure returned by a -% previous call to AcquireMemoryInfo(). +% RelinquishVirtualMemory() frees memory acquired with AcquireVirtualMemory(). % -% The format of the RelinquishMemoryInfo method is: +% The format of the RelinquishVirtualMemory method is: % -% MemoryInfo *RelinquishMemoryInfo(MemoryInfo *memory_info) +% MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info) % % A description of each parameter follows: % % o memory_info: A pointer to a block of memory to free for reuse. % */ -MagickExport MemoryInfo *RelinquishMemoryInfo(MemoryInfo *memory_info) +MagickExport MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info) { assert(memory_info != (MemoryInfo *) NULL); assert(memory_info->signature == MagickSignature); - if (memory_info->memory != (void *) NULL) - memory_info->memory=(void *) NULL; + if (memory_info->blob != (void *) NULL) + memory_info->blob=(void *) NULL; memory_info->signature=(~MagickSignature); memory_info=(MemoryInfo *) RelinquishAlignedMemory(memory_info); return(memory_info); diff --git a/MagickCore/memory_.h b/MagickCore/memory_.h index 2365e78ca..db7aec57e 100644 --- a/MagickCore/memory_.h +++ b/MagickCore/memory_.h @@ -31,8 +31,8 @@ typedef void *(*ResizeMemoryHandler)(void *,size_t) magick_alloc_size(2); extern MagickExport MemoryInfo - *AcquireMemoryInfo(void), - *RelinquishMemoryInfo(MemoryInfo *); + *AcquireVirtualMemory(const size_t,const size_t) magick_alloc_sizes(1,2), + *RelinquishVirtualMemory(MemoryInfo *); extern MagickExport void *AcquireAlignedMemory(const size_t,const size_t) @@ -46,8 +46,7 @@ extern MagickExport void DestroyMagickMemory(void), GetMagickMemoryMethods(AcquireMemoryHandler *,ResizeMemoryHandler *, DestroyMemoryHandler *), - *GetMemoryInfoMemory(MemoryInfo *,const size_t,const size_t) - magick_alloc_sizes(2,3), + *GetVirtualMemoryBlob(const MemoryInfo *), *RelinquishAlignedMemory(void *), *RelinquishMagickMemory(void *), *ResetMagickMemory(void *,int,const size_t),