HTML Tidy: _TidyAllocatorVtbl Struct Reference

HTML Tidy 0.1

Public Member Functions | Data Fields
_TidyAllocatorVtbl Struct Reference
Memory Allocation

`#include <tidy.h>`

## Public Member Functions
void *TIDY_CALL * | alloc (TidyAllocator *self, size_t nBytes)
void *TIDY_CALL * | realloc (TidyAllocator *self, void *block, size_t nBytes)
| void (TIDY_CALL *free)(TidyAllocator *self
| void (TIDY_CALL *panic)(TidyAllocator *self

## Data Fields
void * | block
ctmbstr | msg

## Detailed Description

An allocator's function table. All functions here must be provided.

## Member Function Documentation

void* TIDY_CALL* _TidyAllocatorVtbl::alloc | ( | TidyAllocator * | self,
|  | size_t | nBytes
| ) |  |

Called to allocate a block of nBytes of memory

void* TIDY_CALL* _TidyAllocatorVtbl::realloc | ( | TidyAllocator * | self,
|  | void * | block,
|  | size_t | nBytes
| ) |  |

Called to resize (grow, in general) a block of memory. Must support being called with NULL.

_TidyAllocatorVtbl::void | ( | TIDY_CALL * | free | ) |

Called to free a previously allocated block of memory

_TidyAllocatorVtbl::void | ( | TIDY_CALL * | panic | ) |

Called when a panic condition is detected. Must support block == NULL. This function is not called if either alloc or realloc fails; it is up to the allocator to do this. Currently this function can only be called if an error is detected in the tree integrity via the internal function CheckNodeIntegrity(). This is a situation that can only arise in the case of a programming error in tidylib. You can turn off node integrity checking by defining the constant NO_NODE_INTEGRITY_CHECK during the build.

The documentation for this struct was generated from the following file:

- tidy.h