VCLib Documentation  6.12.2

Fast Buffer

Functions

void fastbuf_setup (header **freex, int *base, int size)
 Uses Memory from Normal Memory to be used as Fast Buffer. More...
 
void fastbuf_free (void *ap)
 Frees Memory Space at the Fast Buffer/Normal Memory. More...
 
void * fastbuf_malloc (unsigned nwords)
 Allocates Memory Space at the Fast Buffer/Normal Memory. More...
 
void addrval_print (U8 *baseTrue, U8 *baseVirt, I32 offsBytes, U32 val, I8 writeIff1)
 

Detailed Description

Functions in this group provide non-standard methods for memory management.

Function Documentation

◆ fastbuf_setup()

void fastbuf_setup ( header **  freex,
int *  base,
int  size 
)

This function uses the word count of size at the given pointer address base as a fast buffer. The base pointer must be allocated first in normal memory, e.g. by using the function call 'base = sysmalloc(size);', and this pointer may not be freed before there are no fastbuf routines operating anymore.

If fastbuf_setup() is not called beforehand, the functions fastbuf_malloc() and fastbuf_free() act like their normal counterparts sysmalloc() and sysfree().

Memory allocated at the fast buffer via fastbuf_malloc(), which is an independent memory manager from the normal OS memory manager must be freed by using the function fastbuf_free(), and not(!) any other free function, like sysfree() or byte_free().

Note
This function requires 'fast buffer' memory e.g., L1D memory within the DM6435 DSP. The proper size and pointer to this memory must be specified.
Parameters
freexthe global header pointer freep.
Return values
basePointer to the allocated Memory.
sizeWord Count allocated.

◆ fastbuf_free()

void fastbuf_free ( void *  ap)

If fastbuf_setup() is not called beforehand, this function acts like sysfree().

Otherwise, it frees memory at the fast buffer, which is an independent memory manager from the normal OS memory manager. This means, if one uses the function, fastbuf_malloc(), to get an allocated pointer, one must free it by using this function, fastbuf_free(), and not(!) any other free function, like sysfree() or byte_free().

Parameters
apPointer to be Freed.

◆ fastbuf_malloc()

void* fastbuf_malloc ( unsigned  nwords)

If fastbuf_setup() is not called beforehand, this function acts like sysmalloc().

Otherwise, it allocates memory at the fast buffer, which is an independent memory manager from the normal OS memory manager. This means, if one uses this function, fastbuf_malloc(), to get an allocated pointer, one must free it by using the function fastbuf_free(), and not(!) any other free function, like sysfree() or byte_free().

Parameters
nwordsCount of Words to allocate.
Return values
AddressOn Success.
NULLIf Memory cannot be Allocated.

◆ addrval_print()

void addrval_print ( U8 baseTrue,
U8 baseVirt,
I32  offsBytes,
U32  val,
I8  writeIff1 
)

Prints out Addresses and Values.

This function prints out addresses and values in various form.