Generic Trace Generator (GTG)  0.1
Functions
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
memoryThe memory describer
ptrThe block of data to free
void * gtg_block_malloc ( gtg_memory_t  memory)

Allocate a block of data.

Parameters
memoryThe 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
memoryA memory describer
block_sizeThe block size to be allocated when malloc is called
initial_block_numberThe number of blocks to allocate initialy