VAT  3.0
Video Analysis Tool
Functions | Variables
GA_alloc.c File Reference

Memory allocation (implementation). More...

#include <stdlib.h>
#include <stdio.h>
#include "GA_alloc.h"

Functions

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

Variables

GAAllocFunc GA_ALLOC_FUNC = (GAAllocFunc)calloc
 
GAFreeFunc GA_FREE_FUNC = (GAFreeFunc)free
 

Detailed Description

Memory allocation (implementation).

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.

Variable Documentation

GAAllocFunc GA_ALLOC_FUNC = (GAAllocFunc)calloc

Global allocation function.

GAFreeFunc GA_FREE_FUNC = (GAFreeFunc)free

Global freeing function.