![]() |
MHEG5
18.9.0
MHEG5 Documentation
|
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"
Go to the source code of this file.
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 |
#define BlkStrAlloc | ( | bk, | |
bz, | |||
ln | |||
) | BlkStrAlloc(bk, bz) |
Definition at line 544 of file glue_memory.c.
#define BlkStrFree | ( | head, | |
bz, | |||
data | |||
) |
Definition at line 52 of file glue_memory.c.
#define CONTROL_SIZE (MAX_BLK_STRS >> 3) |
Definition at line 50 of file glue_memory.c.
#define FreeFunc STB_MemFree |
Definition at line 39 of file glue_memory.c.
#define LARGE_BITS 6 |
Definition at line 47 of file glue_memory.c.
#define MallocFunc STB_MemAlloc |
Definition at line 38 of file glue_memory.c.
#define MAX_BLK_STRS 0x80 /* 128 memory blocks */ |
Definition at line 42 of file glue_memory.c.
#define MEDUM_BITS 5 |
Definition at line 46 of file glue_memory.c.
#define MIGIT_BITS 3 |
Definition at line 44 of file glue_memory.c.
#define SMALL_BITS 4 |
Definition at line 45 of file glue_memory.c.
#define STR_BLCK_SIZE | ( | bz | ) | STR_DATA_SIZE(bz) + sizeof(S_STRINGS_BLOCK) |
Definition at line 49 of file glue_memory.c.
#define STR_DATA_SIZE | ( | bz | ) | (MAX_BLK_STRS << bz) |
Definition at line 48 of file glue_memory.c.
#define theMemSize size |
#define VTINY_BITS 2 |
Definition at line 43 of file glue_memory.c.
typedef struct s_strings_block S_STRINGS_BLOCK |
BOOLEAN MH5GlueMemoryInitialise | ( | void | ) |
Definition at line 807 of file glue_memory.c.
void MH5GlueMemoryTerminate | ( | void | ) |
Definition at line 830 of file glue_memory.c.
Definition at line 924 of file glue_memory.c.
Definition at line 881 of file glue_memory.c.
Definition at line 847 of file glue_memory.c.
Definition at line 956 of file glue_memory.c.
void MH5GlueStringFree | ( | S_STRING * | pStr | ) |
Definition at line 986 of file glue_memory.c.
void MHEG5freeMemFunc | ( | void * | what | ) |
Free some memory allocated by a call to MHEG5getMemFunc.
what | Pointer to allocated memory. |
Definition at line 190 of file glue_memory.c.
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. |
Definition at line 291 of file glue_memory.c.
void MHG_DebugMemStats | ( | int | line | ) |
Definition at line 708 of file glue_memory.c.
unsigned char* STR_DataAlloc | ( | unsigned int | len | ) |
Definition at line 596 of file glue_memory.c.
void STR_DataFree | ( | unsigned char * | data, |
unsigned int | len | ||
) |
Definition at line 668 of file glue_memory.c.
void STR_Shutdown | ( | void | ) |
Definition at line 497 of file glue_memory.c.
void STR_TidyUp | ( | void | ) |
Definition at line 533 of file glue_memory.c.
S_STRINGS_BLOCK* large_strmem_head = NULL |
Definition at line 101 of file glue_memory.c.
S_STRINGS_BLOCK* medum_strmem_head = NULL |
Definition at line 100 of file glue_memory.c.
S_STRINGS_BLOCK* migit_strmem_head = NULL |
Definition at line 98 of file glue_memory.c.
S_STRINGS_BLOCK* small_strmem_head = NULL |
Definition at line 99 of file glue_memory.c.
S_STRINGS_BLOCK* vtiny_strmem_head = NULL |
Definition at line 97 of file glue_memory.c.