Contents
void MagickAllocFunctions( MagickFreeFunc free_func, MagickMallocFunc malloc_func, MagickReallocFunc realloc_func );
MagickAllocFunctions() provides a way for the user to supply a preferred free(), malloc(), and realloc() functions. Otherwise the default system versions are used.
The format of the MagickAllocFunctions method is:
void MagickAllocFunctions( MagickFreeFunc free_func, MagickMallocFunc malloc_func, MagickReallocFunc realloc_func );
void *MagickMalloc( const size_t size );
MagickMalloc() returns a pointer to a block of memory of at least size bytes suitably aligned for any use. NULL is returned if insufficient memory is available or the requested size is zero.
The format of the MagickMalloc method is:
void *MagickMalloc( const size_t size );
A description of each parameter follows:
void *MagickMallocCleared( const size_t size );
MagickMallocCleared() returns a pointer to a block of memory of at least size bytes suitably aligned for any use. NULL is returned if insufficient memory is available or the requested size is zero. This version differs from MagickMalloc in that the allocated bytes are cleared to zero.
The format of the MagickMallocCleared method is:
void *MagickMallocCleared( const size_t size );
A description of each parameter follows:
void *MagickCloneMemory( void *destination, const void *source, const size_t size );
MagickCloneMemory() 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 MagickCloneMemory method is:
void *MagickCloneMemory( void *destination, const void *source, const size_t size );
void *MagickRealloc( void *memory, const size_t size );
MagickRealloc() 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. If size is zero, then the memory is freed and a NULL value is returned. If the memory allocation fails, then the existing memory is freed, and a NULL value is returned.
The format of the MagickRealloc method is:
void *MagickRealloc( void *memory, const size_t size );
A description of each parameter follows:
void MagickFree( void *memory );
MagickFree() frees memory that has already been allocated. A NULL argument is ignored.
The format of the MagickFree method is:
void MagickFree( void *memory );
A description of each parameter follows: