![]() |
MHEG5
22.3.0
|
Implement the system dependend memory functions. More...
#include <stdlib.h>
#include <string.h>
#include "stb_os.h"
#include "glue_debug.h"
#include "glue_memory.h"
Classes | |
struct | s_strings_block |
Macros | |
#define | MallocFunc STB_MemAlloc |
#define | FreeFunc STB_MemFree |
#define | MAX_BLK_STRS 0x80 /* 128 memory blocks */ |
#define | VTINY_BITS 2 |
#define | MIGIT_BITS 3 |
#define | SMALL_BITS 4 |
#define | MEDUM_BITS 5 |
#define | LARGE_BITS 6 |
#define | STR_DATA_SIZE(bz) (MAX_BLK_STRS << bz) |
#define | STR_BLCK_SIZE(bz) STR_DATA_SIZE(bz) + sizeof(S_STRINGS_BLOCK) |
#define | CONTROL_SIZE (MAX_BLK_STRS >> 3) |
#define | BlkStrFree(head, bz, data) |
#define | theMemSize size |
#define | BlkStrAlloc(bk, bz, ln) BlkStrAlloc(bk, bz) |
Typedefs | |
typedef struct s_strings_block | S_STRINGS_BLOCK |
Functions | |
void | MHEG5freeMemFunc (void *what) |
Free some memory allocated by a call to MHEG5getMemFunc. More... | |
void * | MHEG5getMemFunc (int size) |
Allocate a block of memory from the free pool. This function should be called using the macro MHEG5getMem. This ensures that the callingFunction parameter is only passed in when MHEG5LOG is defined. More... | |
void | STR_Shutdown (void) |
void | STR_TidyUp (void) |
unsigned char * | STR_DataAlloc (unsigned int len) |
void | STR_DataFree (unsigned char *data, unsigned int len) |
void | MHG_DebugMemStats (int line) |
BOOLEAN | MH5GlueMemoryInitialise (void) |
void | MH5GlueMemoryTerminate (void) |
S_STRING | MH5GlueStringCopy (S_STRING source) |
S_STRING | MH5GlueStringConcat (S_STRING src1, S_STRING src2) |
S_STRING | MH5GlueStringAlloc (U32BIT size) |
S_STRING | MH5GlueStringCreate (U32BIT size, U8BIT *data) |
void | MH5GlueStringFree (S_STRING *pStr) |
Variables | |
S_STRINGS_BLOCK * | vtiny_strmem_head = NULL |
S_STRINGS_BLOCK * | migit_strmem_head = NULL |
S_STRINGS_BLOCK * | small_strmem_head = NULL |
S_STRINGS_BLOCK * | medum_strmem_head = NULL |
S_STRINGS_BLOCK * | large_strmem_head = NULL |
Implement the system dependend memory functions.
#define BlkStrFree | ( | head, | |
bz, | |||
data | |||
) |
void MHEG5freeMemFunc | ( | void * | what | ) |
Free some memory allocated by a call to MHEG5getMemFunc.
what | Pointer to allocated memory. |
void* MHEG5getMemFunc | ( | int | size | ) |
Allocate a block of memory from the free pool. This function should be called using the macro MHEG5getMem. This ensures that the callingFunction parameter is only passed in when MHEG5LOG is defined.
callingFunction | Pointer to the calling function (only when MHEG5LOG is defined). |
size | Size in bytes of the memory region to allocate. |