# Memory Allocation

## Typedefs
typedef void *(* | TidyMalloc )(size_t len)
typedef void *(* | TidyRealloc )(void *buf, size_t len)
typedef void(* | TidyFree )(void *buf)
typedef void(* | TidyPanic )(ctmbstr mssg)
## Functions
Bool | tidySetMallocCall (TidyMalloc fmalloc)
Bool | tidySetReallocCall (TidyRealloc frealloc)
Bool | tidySetFreeCall (TidyFree ffree)
Bool | tidySetPanicCall (TidyPanic fpanic)

## Detailed Description

By default, Tidy will use its own wrappers around standard C malloc/free calls. These wrappers will abort upon any failures. If any are set, all must be set. Pass NULL to clear previous setting.

May be used to set environment-specific allocators such as used by web server plugins, etc.

## Typedef Documentation

typedef void*(* TidyMalloc)( size_t len )

| Callback for "malloc" replacement

typedef void*(* TidyRealloc)( void* buf, size_t len )

| Callback for "realloc" replacement

typedef void(* TidyFree)( void* buf )

| Callback for "free" replacement

typedef void(* TidyPanic)( ctmbstr mssg )

| Callback for "out of memory" panic state

## Function Documentation

Bool tidySetMallocCall | ( | TidyMalloc | fmalloc | ) |

| Give Tidy a malloc() replacement

Bool tidySetReallocCall | ( | TidyRealloc | frealloc | ) |

| Give Tidy a realloc() replacement

Bool tidySetFreeCall | ( | TidyFree | ffree | ) |

| Give Tidy a free() replacement

Bool tidySetPanicCall | ( | TidyPanic | fpanic | ) |

| Give Tidy an "out of memory" handler