Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 1 | |
| 2 | |
| 3 | |
| 4 | |
cristy | 29dc865 | 2015-05-12 16:26:21 +0000 | [diff] [blame] | 5 | <!DOCTYPE html> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 6 | <html lang="en"> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 7 | <head> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 8 | <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 9 | <title>ImageMagick: MagickCore, C API for ImageMagick: Memory Allocation</title> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 10 | <meta http-equiv="content-type" content="text/html; charset=utf-8"/> |
| 11 | <meta name="application-name" content="ImageMagick"/> |
| 12 | <meta name="description" content="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 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. 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."/> |
| 13 | <meta name="application-url" content="http://www.imagemagick.org"/> |
| 14 | <meta name="generator" content="PHP"/> |
| 15 | <meta name="keywords" content="magickcore, c, api, for, imagemagick:, memory, allocation, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/> |
| 16 | <meta name="rating" content="GENERAL"/> |
| 17 | <meta name="robots" content="INDEX, FOLLOW"/> |
| 18 | <meta name="generator" content="ImageMagick Studio LLC"/> |
| 19 | <meta name="author" content="ImageMagick Studio LLC"/> |
| 20 | <meta name="revisit-after" content="2 DAYS"/> |
| 21 | <meta name="resource-type" content="document"/> |
Cristy | ce4a355 | 2015-12-14 13:53:35 -0500 | [diff] [blame] | 22 | <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 23 | <meta name="distribution" content="Global"/> |
| 24 | <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/> |
| 25 | <link rel="icon" href="../images/wand.png"/> |
| 26 | <link rel="shortcut icon" href="../images/wand.ico"/> |
| 27 | <link rel="stylesheet" href="../css/magick.html"/> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 28 | </head> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 29 | <body> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 30 | <div class="main"> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 31 | <div class="magick-masthead"> |
| 32 | <div class="container"> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 33 | <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 34 | style="display:block" |
| 35 | data-ad-client="ca-pub-3129977114552745" |
| 36 | data-ad-slot="6345125851" |
| 37 | data-ad-format="auto"></ins> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 38 | <script> |
Cristy | 542697a | 2015-10-12 20:10:32 -0400 | [diff] [blame] | 39 | (adsbygoogle = window.adsbygoogle || []).push({}); |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 40 | </script> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 41 | <nav class="magick-nav"> |
cristy | 2f563d4 | 2015-05-06 23:36:51 +0000 | [diff] [blame] | 42 | <a class="magick-nav-item " href="../index.html">Home</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 43 | <a class="magick-nav-item " href="../binary-releases.html">Download</a> |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 44 | <a class="magick-nav-item " href="../command-line-tools.html">Tools</a> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 45 | <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a> |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 46 | <a class="magick-nav-item " href="../resources.html">Resources</a> |
| 47 | <a class="magick-nav-item " href="api.html">Develop</a> |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 48 | <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a> |
cristy | a1890f0 | 2015-05-15 23:32:44 +0000 | [diff] [blame] | 49 | <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 50 | </nav> |
| 51 | </div> |
| 52 | </div> |
| 53 | <div class="container"> |
cristy | 4e638cd | 2015-05-07 16:47:40 +0000 | [diff] [blame] | 54 | <div class="magick-header"> |
Cristy | 594d277 | 2015-11-15 10:47:42 -0500 | [diff] [blame] | 55 | <p class="text-center"><a href="memory.html#AcquireAlignedMemory">AcquireAlignedMemory</a> • <a href="memory.html#AcquireMagickMemory">AcquireMagickMemory</a> • <a href="memory.html#AcquireQuantumMemory">AcquireQuantumMemory</a> • <a href="memory.html#AcquireVirtualMemory">AcquireVirtualMemory</a> • <a href="memory.html#CopyMagickMemory">CopyMagickMemory</a> • <a href="memory.html#GetMagickMemoryMethods">GetMagickMemoryMethods</a> • <a href="memory.html#GetVirtualMemoryBlob">GetVirtualMemoryBlob</a> • <a href="memory.html#RelinquishAlignedMemory">RelinquishAlignedMemory</a> • <a href="memory.html#RelinquishMagickMemory">RelinquishMagickMemory</a> • <a href="memory.html#RelinquishVirtualMemory">RelinquishVirtualMemory</a> • <a href="memory.html#ResetMagickMemory">ResetMagickMemory</a> • <a href="memory.html#ResizeMagickMemory">ResizeMagickMemory</a> • <a href="memory.html#ResizeQuantumMemory">ResizeQuantumMemory</a> • <a href="memory.html#SetMagickMemoryMethods">SetMagickMemoryMethods</a></p> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 56 | |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 57 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="AcquireAlignedMemory">AcquireAlignedMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 58 | |
| 59 | <p>AcquireAlignedMemory() returns a pointer to a block of memory at least size bytes whose address is a multiple of 16*sizeof(void *).</p> |
| 60 | |
| 61 | <p>The format of the AcquireAlignedMemory method is:</p> |
| 62 | |
| 63 | <pre class="text"> |
| 64 | void *AcquireAlignedMemory(const size_t count,const size_t quantum) |
| 65 | </pre> |
| 66 | |
| 67 | <p>A description of each parameter follows:</p> |
| 68 | |
| 69 | <dd> |
| 70 | </dd> |
| 71 | |
| 72 | <dd> </dd> |
| 73 | <dl class="dl-horizontal"> |
| 74 | <dt>count</dt> |
| 75 | <dd>the number of quantum elements to allocate. </dd> |
| 76 | |
| 77 | <dd> </dd> |
| 78 | <dt>quantum</dt> |
| 79 | <dd>the number of bytes in each quantum. </dd> |
| 80 | |
| 81 | <dd> </dd> |
| 82 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 83 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="AcquireMagickMemory">AcquireMagickMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 84 | |
| 85 | <p>AcquireMagickMemory() returns a pointer to a block of memory at least size bytes suitably aligned for any use.</p> |
| 86 | |
| 87 | <p>The format of the AcquireMagickMemory method is:</p> |
| 88 | |
| 89 | <pre class="text"> |
| 90 | void *AcquireMagickMemory(const size_t size) |
| 91 | </pre> |
| 92 | |
| 93 | <p>A description of each parameter follows:</p> |
| 94 | |
| 95 | <dd> |
| 96 | </dd> |
| 97 | |
| 98 | <dd> </dd> |
| 99 | <dl class="dl-horizontal"> |
| 100 | <dt>size</dt> |
| 101 | <dd>the size of the memory in bytes to allocate. </dd> |
| 102 | |
| 103 | <dd> </dd> |
| 104 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 105 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="AcquireQuantumMemory">AcquireQuantumMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 106 | |
| 107 | <p>AcquireQuantumMemory() returns a pointer to a block of memory at least count * quantum bytes suitably aligned for any use.</p> |
| 108 | |
| 109 | <p>The format of the AcquireQuantumMemory method is:</p> |
| 110 | |
| 111 | <pre class="text"> |
| 112 | void *AcquireQuantumMemory(const size_t count,const size_t quantum) |
| 113 | </pre> |
| 114 | |
| 115 | <p>A description of each parameter follows:</p> |
| 116 | |
| 117 | <dd> |
| 118 | </dd> |
| 119 | |
| 120 | <dd> </dd> |
| 121 | <dl class="dl-horizontal"> |
| 122 | <dt>count</dt> |
| 123 | <dd>the number of quantum elements to allocate. </dd> |
| 124 | |
| 125 | <dd> </dd> |
| 126 | <dt>quantum</dt> |
| 127 | <dd>the number of bytes in each quantum. </dd> |
| 128 | |
| 129 | <dd> </dd> |
| 130 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 131 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="AcquireVirtualMemory">AcquireVirtualMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 132 | |
| 133 | <p>AcquireVirtualMemory() allocates a pointer to a block of memory at least size bytes suitably aligned for any use.</p> |
| 134 | |
| 135 | <p>The format of the AcquireVirtualMemory method is:</p> |
| 136 | |
| 137 | <pre class="text"> |
| 138 | MemoryInfo *AcquireVirtualMemory(const size_t count,const size_t quantum) |
| 139 | </pre> |
| 140 | |
| 141 | <p>A description of each parameter follows:</p> |
| 142 | |
| 143 | <dd> |
| 144 | </dd> |
| 145 | |
| 146 | <dd> </dd> |
| 147 | <dl class="dl-horizontal"> |
| 148 | <dt>count</dt> |
| 149 | <dd>the number of quantum elements to allocate. </dd> |
| 150 | |
| 151 | <dd> </dd> |
| 152 | <dt>quantum</dt> |
| 153 | <dd>the number of bytes in each quantum. </dd> |
| 154 | |
| 155 | <dd> </dd> |
| 156 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 157 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="CopyMagickMemory">CopyMagickMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 158 | |
| 159 | <p>CopyMagickMemory() copies size bytes from memory area source to the destination. Copying between objects that overlap will take place correctly. It returns destination.</p> |
| 160 | |
| 161 | <p>The format of the CopyMagickMemory method is:</p> |
| 162 | |
| 163 | <pre class="text"> |
| 164 | void *CopyMagickMemory(void *destination,const void *source, |
| 165 | const size_t size) |
| 166 | </pre> |
| 167 | |
| 168 | <p>A description of each parameter follows:</p> |
| 169 | |
| 170 | <dd> |
| 171 | </dd> |
| 172 | |
| 173 | <dd> </dd> |
| 174 | <dl class="dl-horizontal"> |
| 175 | <dt>destination</dt> |
| 176 | <dd>the destination. </dd> |
| 177 | |
| 178 | <dd> </dd> |
| 179 | <dt>source</dt> |
| 180 | <dd>the source. </dd> |
| 181 | |
| 182 | <dd> </dd> |
| 183 | <dt>size</dt> |
| 184 | <dd>the size of the memory in bytes to allocate. </dd> |
| 185 | |
| 186 | <dd> </dd> |
| 187 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 188 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="GetMagickMemoryMethods">GetMagickMemoryMethods</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 189 | |
| 190 | <p>GetMagickMemoryMethods() gets the methods to acquire, resize, and destroy memory.</p> |
| 191 | |
| 192 | <p>The format of the GetMagickMemoryMethods() method is:</p> |
| 193 | |
| 194 | <pre class="text"> |
| 195 | void GetMagickMemoryMethods(AcquireMemoryHandler *acquire_memory_handler, |
| 196 | ResizeMemoryHandler *resize_memory_handler, |
| 197 | DestroyMemoryHandler *destroy_memory_handler) |
| 198 | </pre> |
| 199 | |
| 200 | <p>A description of each parameter follows:</p> |
| 201 | |
| 202 | <dd> |
| 203 | </dd> |
| 204 | |
| 205 | <dd> </dd> |
| 206 | <dl class="dl-horizontal"> |
| 207 | <dt>acquire_memory_handler</dt> |
| 208 | <dd>method to acquire memory (e.g. malloc). </dd> |
| 209 | |
| 210 | <dd> </dd> |
| 211 | <dt>resize_memory_handler</dt> |
| 212 | <dd>method to resize memory (e.g. realloc). </dd> |
| 213 | |
| 214 | <dd> </dd> |
| 215 | <dt>destroy_memory_handler</dt> |
| 216 | <dd>method to destroy memory (e.g. free). </dd> |
| 217 | |
| 218 | <dd> </dd> |
| 219 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 220 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="GetVirtualMemoryBlob">GetVirtualMemoryBlob</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 221 | |
| 222 | <p>GetVirtualMemoryBlob() returns the virtual memory blob associated with the specified MemoryInfo structure.</p> |
| 223 | |
| 224 | <p>The format of the GetVirtualMemoryBlob method is:</p> |
| 225 | |
| 226 | <pre class="text"> |
| 227 | void *GetVirtualMemoryBlob(const MemoryInfo *memory_info) |
| 228 | </pre> |
| 229 | |
| 230 | <p>A description of each parameter follows:</p> |
| 231 | |
| 232 | <dd> |
| 233 | </dd> |
| 234 | |
| 235 | <dd> </dd> |
| 236 | <dl class="dl-horizontal"> |
| 237 | <dt>memory_info</dt> |
| 238 | <dd>The MemoryInfo structure. </dd> |
| 239 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 240 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="RelinquishAlignedMemory">RelinquishAlignedMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 241 | |
| 242 | <p>RelinquishAlignedMemory() frees memory acquired with AcquireAlignedMemory() or reuse.</p> |
| 243 | |
| 244 | <p>The format of the RelinquishAlignedMemory method is:</p> |
| 245 | |
| 246 | <pre class="text"> |
| 247 | void *RelinquishAlignedMemory(void *memory) |
| 248 | </pre> |
| 249 | |
| 250 | <p>A description of each parameter follows:</p> |
| 251 | |
| 252 | <dd> |
| 253 | </dd> |
| 254 | |
| 255 | <dd> </dd> |
| 256 | <dl class="dl-horizontal"> |
| 257 | <dt>memory</dt> |
| 258 | <dd>A pointer to a block of memory to free for reuse. </dd> |
| 259 | |
| 260 | <dd> </dd> |
| 261 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 262 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="RelinquishMagickMemory">RelinquishMagickMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 263 | |
| 264 | <p>RelinquishMagickMemory() frees memory acquired with AcquireMagickMemory() or AcquireQuantumMemory() for reuse.</p> |
| 265 | |
| 266 | <p>The format of the RelinquishMagickMemory method is:</p> |
| 267 | |
| 268 | <pre class="text"> |
| 269 | void *RelinquishMagickMemory(void *memory) |
| 270 | </pre> |
| 271 | |
| 272 | <p>A description of each parameter follows:</p> |
| 273 | |
| 274 | <dd> |
| 275 | </dd> |
| 276 | |
| 277 | <dd> </dd> |
| 278 | <dl class="dl-horizontal"> |
| 279 | <dt>memory</dt> |
| 280 | <dd>A pointer to a block of memory to free for reuse. </dd> |
| 281 | |
| 282 | <dd> </dd> |
| 283 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 284 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="RelinquishVirtualMemory">RelinquishVirtualMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 285 | |
| 286 | <p>RelinquishVirtualMemory() frees memory acquired with AcquireVirtualMemory().</p> |
| 287 | |
| 288 | <p>The format of the RelinquishVirtualMemory method is:</p> |
| 289 | |
| 290 | <pre class="text"> |
| 291 | MemoryInfo *RelinquishVirtualMemory(MemoryInfo *memory_info) |
| 292 | </pre> |
| 293 | |
| 294 | <p>A description of each parameter follows:</p> |
| 295 | |
| 296 | <dd> |
| 297 | </dd> |
| 298 | |
| 299 | <dd> </dd> |
| 300 | <dl class="dl-horizontal"> |
| 301 | <dt>memory_info</dt> |
| 302 | <dd>A pointer to a block of memory to free for reuse. </dd> |
| 303 | |
| 304 | <dd> </dd> |
| 305 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 306 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="ResetMagickMemory">ResetMagickMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 307 | |
| 308 | <p>ResetMagickMemory() fills the first size bytes of the memory area pointed to by memory with the constant byte c.</p> |
| 309 | |
| 310 | <p>The format of the ResetMagickMemory method is:</p> |
| 311 | |
| 312 | <pre class="text"> |
| 313 | void *ResetMagickMemory(void *memory,int byte,const size_t size) |
| 314 | </pre> |
| 315 | |
| 316 | <p>A description of each parameter follows:</p> |
| 317 | |
| 318 | <dd> |
| 319 | </dd> |
| 320 | |
| 321 | <dd> </dd> |
| 322 | <dl class="dl-horizontal"> |
| 323 | <dt>memory</dt> |
| 324 | <dd>a pointer to a memory allocation. </dd> |
| 325 | |
| 326 | <dd> </dd> |
| 327 | <dt>byte</dt> |
| 328 | <dd>set the memory to this value. </dd> |
| 329 | |
| 330 | <dd> </dd> |
| 331 | <dt>size</dt> |
| 332 | <dd>size of the memory to reset. </dd> |
| 333 | |
| 334 | <dd> </dd> |
| 335 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 336 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="ResizeMagickMemory">ResizeMagickMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 337 | |
| 338 | <p>ResizeMagickMemory() 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.</p> |
| 339 | |
| 340 | <p>The format of the ResizeMagickMemory method is:</p> |
| 341 | |
| 342 | <pre class="text"> |
| 343 | void *ResizeMagickMemory(void *memory,const size_t size) |
| 344 | </pre> |
| 345 | |
| 346 | <p>A description of each parameter follows:</p> |
| 347 | |
| 348 | <dd> |
| 349 | </dd> |
| 350 | |
| 351 | <dd> </dd> |
| 352 | <dl class="dl-horizontal"> |
| 353 | <dt>memory</dt> |
| 354 | <dd>A pointer to a memory allocation. </dd> |
| 355 | |
| 356 | <dd> </dd> |
| 357 | <dt>size</dt> |
| 358 | <dd>the new size of the allocated memory. </dd> |
| 359 | |
| 360 | <dd> </dd> |
| 361 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 362 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="ResizeQuantumMemory">ResizeQuantumMemory</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 363 | |
| 364 | <p>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.</p> |
| 365 | |
| 366 | <p>The format of the ResizeQuantumMemory method is:</p> |
| 367 | |
| 368 | <pre class="text"> |
| 369 | void *ResizeQuantumMemory(void *memory,const size_t count, |
| 370 | const size_t quantum) |
| 371 | </pre> |
| 372 | |
| 373 | <p>A description of each parameter follows:</p> |
| 374 | |
| 375 | <dd> |
| 376 | </dd> |
| 377 | |
| 378 | <dd> </dd> |
| 379 | <dl class="dl-horizontal"> |
| 380 | <dt>memory</dt> |
| 381 | <dd>A pointer to a memory allocation. </dd> |
| 382 | |
| 383 | <dd> </dd> |
| 384 | <dt>count</dt> |
| 385 | <dd>the number of quantum elements to allocate. </dd> |
| 386 | |
| 387 | <dd> </dd> |
| 388 | <dt>quantum</dt> |
| 389 | <dd>the number of bytes in each quantum. </dd> |
| 390 | |
| 391 | <dd> </dd> |
| 392 | </dl> |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 393 | <h2><a href="http://www.imagemagick.org/api/MagickCore/memory_8c.html" id="SetMagickMemoryMethods">SetMagickMemoryMethods</a></h2> |
cristy | cecc949 | 2015-06-09 16:53:50 +0000 | [diff] [blame] | 394 | |
| 395 | <p>SetMagickMemoryMethods() sets the methods to acquire, resize, and destroy memory. Your custom memory methods must be set prior to the MagickCoreGenesis() method.</p> |
| 396 | |
| 397 | <p>The format of the SetMagickMemoryMethods() method is:</p> |
| 398 | |
| 399 | <pre class="text"> |
| 400 | SetMagickMemoryMethods(AcquireMemoryHandler acquire_memory_handler, |
| 401 | ResizeMemoryHandler resize_memory_handler, |
| 402 | DestroyMemoryHandler destroy_memory_handler) |
| 403 | </pre> |
| 404 | |
| 405 | <p>A description of each parameter follows:</p> |
| 406 | |
| 407 | <dd> |
| 408 | </dd> |
| 409 | |
| 410 | <dd> </dd> |
| 411 | <dl class="dl-horizontal"> |
| 412 | <dt>acquire_memory_handler</dt> |
| 413 | <dd>method to acquire memory (e.g. malloc). </dd> |
| 414 | |
| 415 | <dd> </dd> |
| 416 | <dt>resize_memory_handler</dt> |
| 417 | <dd>method to resize memory (e.g. realloc). </dd> |
| 418 | |
| 419 | <dd> </dd> |
| 420 | <dt>destroy_memory_handler</dt> |
| 421 | <dd>method to destroy memory (e.g. free). </dd> |
| 422 | |
| 423 | <dd> </dd> |
| 424 | </dl> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 425 | </div> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 426 | <footer class="magick-footer"> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 427 | <p><a href="../support.html">Donate</a> • |
| 428 | <a href="../sitemap.html">Sitemap</a> • |
cristy | 3818536 | 2015-05-07 20:09:56 +0000 | [diff] [blame] | 429 | <a href="../links.html">Related</a> • |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 430 | <a href="../architecture.html">Architecture</a> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 431 | </p> |
| 432 | <p><a href="memory.html#">Back to top</a> • |
cristy | ea2793e | 2015-05-31 16:52:26 +0000 | [diff] [blame] | 433 | <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • |
cristy | 5b8fe76 | 2015-06-09 16:24:03 +0000 | [diff] [blame] | 434 | <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p> |
Cristy | ce4a355 | 2015-12-14 13:53:35 -0500 | [diff] [blame] | 435 | <p><small>© 1999-2015 ImageMagick Studio LLC</small></p> |
cristy | 44443b9 | 2015-05-05 00:06:07 +0000 | [diff] [blame] | 436 | </footer> |
| 437 | </div><!-- /.container --> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 438 | |
Cristy | e93be68 | 2015-11-26 09:07:51 -0500 | [diff] [blame] | 439 | <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script> |
cristy | 29f2c97 | 2015-07-28 13:37:46 +0000 | [diff] [blame] | 440 | <script src="http://nextgen.imagemagick.org/js/magick.html"></script> |
cristy | 44cbd48 | 2013-08-04 20:53:36 +0000 | [diff] [blame] | 441 | </div> |
cristy | 06f63f2 | 2012-10-31 00:50:07 +0000 | [diff] [blame] | 442 | </body> |
cristy | 5a367e4 | 2015-05-05 12:39:18 +0000 | [diff] [blame] | 443 | </html> |