
Go to the source code of this file.
Functions | |
| OFC_CORE_LIB OFC_VOID | ofc_heap_load (OFC_VOID) |
| OFC_CORE_LIB OFC_VOID | ofc_heap_unload (OFC_VOID) |
| OFC_CORE_LIB OFC_VOID | ofc_free (OFC_LPVOID mem) |
| OFC_CORE_LIB OFC_VOID | ofc_heap_check_alloc (OFC_LPCVOID mem) |
| OFC_CORE_LIB OFC_VOID | ofc_heap_dump_chunk (OFC_LPVOID mem) |
| OFC_CORE_LIB OFC_LPVOID | ofc_malloc (OFC_SIZET size) |
| OFC_CORE_LIB OFC_LPVOID | ofc_calloc (OFC_SIZET nmemb, OFC_SIZET size) |
| OFC_CORE_LIB OFC_LPVOID | ofc_realloc (OFC_LPVOID ptr, OFC_SIZET size) |
| OFC_CORE_LIB OFC_VOID | ofc_heap_dump_stats (OFC_VOID) |
| OFC_CORE_LIB OFC_VOID | ofc_heap_dump (OFC_VOID) |
| OFC_CORE_LIB OFC_VOID | ofc_heap_snap (OFC_VOID) |
| OFC_CORE_LIB OFC_LPVOID ofc_calloc | ( | OFC_SIZET | nmemb, |
| OFC_SIZET | size | ||
| ) |
Allocate and initiaize chunk of memory
| nmemb | Number of structure to allocate |
| size | size of structure |
| OFC_CORE_LIB OFC_VOID ofc_free | ( | OFC_LPVOID | mem | ) |
Deallocate a chunk of memory
This may be mapped to a free on many platforms.
| mem | A pointer to the memory to deallocate. |
| OFC_CORE_LIB OFC_VOID ofc_heap_check_alloc | ( | OFC_LPCVOID | mem | ) |
Check the allocation of a heap.
This will crash if the memory is not allocated
| mem | Pointer to memory chunk |
Dump Heap Trace
This will print to the console a record for each chunk of memory that had been allocated includding who allocated it, the address of the chunk and the size of the chunk.
| OFC_CORE_LIB OFC_VOID ofc_heap_dump_chunk | ( | OFC_LPVOID | mem | ) |
Dump the debug status of a memory chunk
| mem | Pointer to memory chunk |
Dump Heap Stats Usuage
This will print to the console the number of bytes used as well as the maximum number of bytes that had been used
Initialize the Heap
This function is only called by ofc_init. It will initialize the heap for use. This may be a noop on many platforms
Snap the Heap
Mark all allocated blocks in the heap as previously allocated. Only those chunks that are 'not snapped' will be printed upon a dump
| OFC_CORE_LIB OFC_LPVOID ofc_malloc | ( | OFC_SIZET | size | ) |
Allocate a chunk of memory
This may be mapped to a malloc on many platforms
| size | size of the memory block to allocate |
| OFC_CORE_LIB OFC_LPVOID ofc_realloc | ( | OFC_LPVOID | ptr, |
| OFC_SIZET | size | ||
| ) |
Change the size (reallocate) a chunk of memory
This may be mapped to a realloc on many platforms
| ptr | Pointer to the initial chunk of memory |
| size | size of the new memory block |