]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 22 Jun 2013 00:54:32 +0000 (00:54 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 22 Jun 2013 00:54:32 +0000 (00:54 +0000)
MagickCore/memory.c
MagickCore/memory_.h

index 617129c44d694fd0f0639ef8f1c5b8506d6f09a5..c7cfaf0e365cc80ba965c5f3e3dde62b2dab4676 100644 (file)
@@ -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);
 }
 \f
 /*
@@ -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);
index 2365e78ca126595725f9c2274aa1648be500aa0f..db7aec57eeae68760424cea14ef967c9796e1224 100644 (file)
@@ -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),