VAT  3.0
Video Analysis Tool
Typedefs | Functions
GA_alloc.h File Reference

Memory allocation. More...

#include <stdlib.h>

Go to the source code of this file.

Typedefs

typedef char *(* GAAllocFunc) (size_t, int)
 
typedef void(* GAFreeFunc) (char *)
 

Functions

void GA_set_alloc_funcs (GAAllocFunc allocFunc, GAFreeFunc freeFunc)
 
char * GA_alloc (size_t numElem, int eltSize)
 
void GA_free (char *memLoc)
 

Detailed Description

Memory allocation.

This module provides memory allocation services to the package. The allocation functions to be used can be set at run-time.

Typedef Documentation

typedef char*(* GAAllocFunc) (size_t, int)

Memory allocation function.

This is the specification of the memory allocation function which can be set using GA_set_alloc_funcs.

typedef void(* GAFreeFunc) (char *)

Memory freeing function.

This is the specification of the memory freeing function which can be set using GA_set_alloc_funcs.

Function Documentation

char* GA_alloc ( size_t  numElem,
int  eltSize 
)

Allocate memory.

Allocate memory using the currently set allocation function.

Parameters
numElemNumber of elements to allocate.
eltSizeElement size.
Returns
Result of allocation.
void GA_free ( char *  memLoc)

Free memory.

Free memory using the currently set freeing function.

Parameters
memLocMemory location to be freed.
void GA_set_alloc_funcs ( GAAllocFunc  allocFunc,
GAFreeFunc  freeFunc 
)

Set allocation functions.

Set the memory allocation functions to be used.

Parameters
allocFuncAllocation function.
freeFuncFreeing function.