Memory management

## Functions

void | gtg_block_memory_init (gtg_memory_t *memory, size_t block_size, long initial_block_number)
| Initialize the allocator. More...
void * | gtg_block_malloc (gtg_memory_t memory)
| Allocate a block of data. More...
void | gtg_block_free (gtg_memory_t memory, void *ptr)
| Free a block of data. More...

## Detailed Description

## Function Documentation

void gtg_block_free | ( | gtg_memory_t | memory,
|  | void * | ptr
| ) |  |

Free a block of data.

Parameters

  memory | The memory describer
  ptr | The block of data to free

void * gtg_block_malloc | ( | gtg_memory_t | memory | ) |

Allocate a block of data.

Parameters

  memory | The memory describer

Returns
  A pointer to a block or NULL if allocation failed

void gtg_block_memory_init | ( | gtg_memory_t * | memory,
|  | size_t | block_size,
|  | long | initial_block_number
| ) |  |

Initialize the allocator.

Parameters

  memory | A memory describer
  block_size | The block size to be allocated when malloc is called
  initial_block_number | The number of blocks to allocate initialy