diff options
Diffstat (limited to 'src/gos/gos_x_heap.h')
-rw-r--r-- | src/gos/gos_x_heap.h | 38 |
1 files changed, 15 insertions, 23 deletions
diff --git a/src/gos/gos_x_heap.h b/src/gos/gos_x_heap.h index 0fbfc905..1434b991 100644 --- a/src/gos/gos_x_heap.h +++ b/src/gos/gos_x_heap.h @@ -14,31 +14,23 @@ /* Type definitions */ /*===========================================================================*/ -#ifdef __cplusplus -extern "C" { +#if GFX_OS_HEAP_SIZE != 0 || defined(__DOXYGEN__) + /** + * @brief Take a chunk of memory and add it to the available heap + * @note Memory added must obviously not already be on the heap. + * @note It is allowable to add multiple non-contiguous blocks of memory + * to the heap. If however it is contiguous with a previously added block + * it will get merged with the existing block in order to allow + * allocations that span the boundary. + * @pre GFX_OS_HEAP_SIZE != 0 and an operating system that uses the + * internal ugfx heap allocator rather than its own allocator. + */ + void gfxAddHeapBlock(void *ptr, size_t sz); #endif - #if GFX_OS_HEAP_SIZE != 0 || defined(__DOXYGEN__) - /** - * @brief Take a chunk of memory and add it to the available heap - * @note Memory added must obviously not already be on the heap. - * @note It is allowable to add multiple non-contiguous blocks of memory - * to the heap. If however it is contiguous with a previously added block - * it will get merged with the existing block in order to allow - * allocations that span the boundary. - * @pre GFX_OS_HEAP_SIZE != 0 and an operating system that uses the - * internal ugfx heap allocator rather than its own allocator. - */ - void gfxAddHeapBlock(void *ptr, size_t sz); - #endif - - void *gfxAlloc(size_t sz); - void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz); - void gfxFree(void *ptr); - -#ifdef __cplusplus -} -#endif +void *gfxAlloc(size_t sz); +void *gfxRealloc(void *ptr, size_t oldsz, size_t newsz); +void gfxFree(void *ptr); #endif /* GOS_NEED_X_HEAP */ #endif /* _GOS_X_HEAP_H */ |