DVBCore  17.9.0
Open Source DVB Engine
 All Data Structures Files Functions Typedefs Macros Pages
Macros | Typedefs | Functions
stbheap.c File Reference

Heap memory management routines. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <techtype.h>
#include <dbgfuncs.h>
#include "stbheap.h"
#include "stbhwmem.h"

Macros

#define _STBHEAP_C
 
#define STB_HEAP_PRINT(x)
 

Typedefs

typedef struct s_stat_mem S_STAT_MEM
 
typedef struct s_cache_registration S_CACHE_REGISTRATION
 

Functions

void STB_HeapInitialise (void)
 
void * STB_GetMemory (U32BIT bytes)
 Attempts to allocate memory from the heap. More...
 
void STB_FreeMemory (void *addr)
 Releases previously allocated heap memory. More...
 
void * STB_ResizeMemory (void *ptr, U32BIT new_num_bytes)
 Re-allocates a given memory area to the new size, ensuring data contained within the original memory block is maintained. More...
 
void * STB_AppGetMemory (U32BIT bytes)
 Attempts to allocate memory from the application heap. More...
 
void STB_AppFreeMemory (void *addr)
 Releases previously allocated application heap memory. More...
 
void * STB_AppResizeMemory (void *ptr, U32BIT new_num_bytes)
 Re-allocates a given memory area to the new size, ensuring data contained within the original memory block is maintained. More...
 
void STB_AppRegisterCacheFreeFunction (BOOLEAN(*callback_function)(void))
 

Detailed Description

Heap memory management routines.

Date
06/09/2000

Function Documentation

void STB_AppFreeMemory ( void *  addr)

Releases previously allocated application heap memory.

Parameters
addr- pointer to block to release.
void* STB_AppGetMemory ( U32BIT  bytes)

Attempts to allocate memory from the application heap.

Parameters
bytes- block size required in bytes
Returns
Pointer to block allocated or NULL on failure.
void* STB_AppResizeMemory ( void *  ptr,
U32BIT  new_num_bytes 
)

Re-allocates a given memory area to the new size, ensuring data contained within the original memory block is maintained.

Parameters
ptr- pointer to block to re-allocate.
new_num_bytes- size of new memory block
Returns
Pointer to the new (re-sized) memory block.
void STB_FreeMemory ( void *  addr)

Releases previously allocated heap memory.

Parameters
addr- pointer to block to release.
void* STB_GetMemory ( U32BIT  bytes)

Attempts to allocate memory from the heap.

Parameters
bytes- block size required in bytes
Returns
Pointer to block allocated or NULL on failure.
void* STB_ResizeMemory ( void *  ptr,
U32BIT  new_num_bytes 
)

Re-allocates a given memory area to the new size, ensuring data contained within the original memory block is maintained.

Parameters
ptr- pointer to block to re-allocate.
new_num_bytes- size of new memory block
Returns
Pointer to the new (re-sized) memory block.