m+I=memory - ImageMagick Memory Allocation Methods>j Pair








NAME

5

memory - ImageMagick Memory Allocation Methods






(

SYNOPSIS

B

void * AcquireMemory( const size_t size );

g

void * CloneMemory( void *destination, const void *source, const size_t size );

?

void LiberateMemory( void ** memory );

S

void ReacquireMemory( void ** memory, const size_t size );






B

FUNCTION DESCRIPTIONS





2

AcquireMemory

³
AcquireMemory() returns a pointer to a block of memory at least size bytes suitably aligned for any use.

The format of the AcquireMemory method is:

s
void *AcquireMemory ( const size_t size );

A description of each parameter follows:


?
o size:


,The size of the memory in bytes to allocate.





.

CloneMemory

ì
CloneMemory() copies size bytes from memory area source to the destination. Copying between objects that overlap will take place correctly. It returns destination.

The format of the CloneMemory method is:

˜
void *CloneMemory ( void *destination, const void *source, const size_t size );

A description of each parameter follows:


"
o size:


,The size of the memory in bytes to allocate.





4

LiberateMemory

§
LiberateMemory() frees memory that has already been allocated, and NULLs the pointer to it.

The format of the LiberateMemory method is:

o
void LiberateMemory ( void **memory );

A description of each parameter follows:


C
o memory:


1A pointer to a block of memory to free for reuse.





6

ReacquireMemory

þ
ReacquireMemory() 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 ReacquireMemory method is:

ƒ
void ReacquireMemory ( void **memory, const size_t size );

A description of each parameter follows:


$
o memory:


yA pointer to a memory allocation. On return the pointer may change but the contents of the original allocation will not.


"
o size:


%The new size of the allocated memory.