DIPlib Documentation - ©1995-2013 Quantitative Imaging Group, Delft University of Technology.

# MemoryFunctionsSet

Sets memory allocation functions

## SYNOPSIS

dip_Error dip_MemoryFunctionsSet( MemoryNewFunction, MemoryReallocateFunction, MemoryFreeFunction )

## FUNCTION

Sets the memory allocation functions used by DIPlib.

## ARGUMENTS

Data type | Name | Description
`dip_MemoryNewFunction` | `MemoryNewFunction` | pointer to a memory allocation function
`dip_MemoryReallocateFunction` | `MemoryReallocateFunction` | pointer to a memory reallocation function
`dip_MemoryFreeFunction` | `MemoryFreeFunction` | pointer to a memory freeing function

## NOTE

The three allocation functions are defined as follows:

typedef void* (*dip_MemoryNewFunction)(size_t size)

typedef void* (*dip_MemoryReallocateFunction)(void *ptr, size_t size)

typedef void (*dip_MemoryFreeFunction)(void *ptr)

And are by default set to `malloc`, `realloc` and `free`.

## SEE ALSO

`MemoryNew`, `MemoryReallocate`, `MemoryFree`