From 41dd93ab0488f8ba79daf8fe94621628c05494af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 21 Mar 2017 21:15:12 -0700 Subject: [PATCH] Cleanup. --- include/bx/allocator.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/include/bx/allocator.h b/include/bx/allocator.h index bf1e4dd..77646a5 100644 --- a/include/bx/allocator.h +++ b/include/bx/allocator.h @@ -40,11 +40,14 @@ namespace bx { + /// Abstract allocator interface. + /// struct BX_NO_VTABLE AllocatorI { + /// virtual ~AllocatorI() = 0; - /// Allocated, resizes memory block or frees memory. + /// Allocates, resizes memory block, or frees memory. /// /// @param[in] _ptr If _ptr is NULL new block will be allocated. /// @param[in] _size If _ptr is set, and _size is 0, memory will be freed. @@ -64,7 +67,7 @@ namespace bx , size_t _align = BX_CONFIG_ALLOCATOR_NATURAL_ALIGNMENT ); - /// + /// Allocate memory. void* alloc( AllocatorI* _allocator , size_t _size @@ -73,7 +76,7 @@ namespace bx , uint32_t _line = 0 ); - /// + /// Free memory. void free( AllocatorI* _allocator , void* _ptr @@ -82,7 +85,7 @@ namespace bx , uint32_t _line = 0 ); - /// + /// Resize memory block. void* realloc( AllocatorI* _allocator , void* _ptr @@ -92,7 +95,7 @@ namespace bx , uint32_t _line = 0 ); - /// + /// Allocate memory with specific alignment. void* alignedAlloc( AllocatorI* _allocator , size_t _size @@ -101,7 +104,7 @@ namespace bx , uint32_t _line = 0 ); - /// + /// Free memory that was allocated with aligned allocator. void alignedFree( AllocatorI* _allocator , void* _ptr @@ -110,7 +113,7 @@ namespace bx , uint32_t _line = 0 ); - /// + /// Resize memory block that was allocated with aligned allocator. void* alignedRealloc( AllocatorI* _allocator , void* _ptr @@ -120,7 +123,7 @@ namespace bx , uint32_t _line = 0 ); - /// + /// Delete object with specific allocator. template void deleteObject( AllocatorI* _allocator