memory - ImageMagick Memory Allocation Methods

- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS

- AcquireMemory
- LiberateMemory
- ReacquireMemory

# NAME

memory - ImageMagick Memory Allocation Methods

# SYNOPSIS

void * AcquireMemory( const size_t size );

void LiberateMemory( void ** memory );

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

# FUNCTION DESCRIPTIONS

## AcquireMemory

Method AcquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.

The format of the AcquireMemory method is:

> void *AcquireMemory ( const size_t size );

A description of each parameter follows:

memory:
  Method AcquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.

size:
  Specifies the size of the memory to return.

## LiberateMemory

Method LiberateMemory frees memory that has already been allocated.

The format of the LiberateMemory method is:

> void LiberateMemory ( void **memory );

A description of each parameter follows:

span:
  Specifies the pointer to a block memory to free for reuse.

## ReacquireMemory

Method 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:

memory:
  Method ReacquireMemory returns a pointer to a block of at least size bytes suitably aligned for any use.

size:
  Specifies the size of the memory to return.