Generic Trace Generator (GTG) 0.1
Memory management

Functions

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

Detailed Description

Function Documentation

◆ gtg_block_free()

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

◆ gtg_block_malloc()

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

◆ gtg_block_memory_init()

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