Reformat
This commit is contained in:
@@ -25,7 +25,9 @@ struct arena {
|
||||
};
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena API definitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
bool wapp_mem_arena_init_custom(Arena **arena, u64 base_capacity,
|
||||
@@ -119,4 +121,4 @@ void wapp_mem_arena_destroy(Arena **arena) {
|
||||
*arena = NULL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -12,7 +12,9 @@ extern "C" {
|
||||
typedef struct arena Arena;
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena wrapper macros
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
#define wapp_mem_arena_init(arena_dptr, base_capacity) \
|
||||
@@ -30,10 +32,12 @@ typedef struct arena Arena;
|
||||
WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, \
|
||||
true))
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena API declarations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
/**
|
||||
@@ -48,7 +52,7 @@ void *wapp_mem_arena_alloc_aligned(Arena *arena, u64 size, u64 alignment);
|
||||
void wapp_mem_arena_clear(Arena *arena);
|
||||
void wapp_mem_arena_destroy(Arena **arena);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -2,17 +2,21 @@
|
||||
#include "mem_arena.h"
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena Allocator wrappers declarations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
internal inline void *mem_arena_alloc(u64 size, void *alloc_obj);
|
||||
internal inline void *mem_arena_alloc_aligned(u64 size, u64 alignment,
|
||||
void *alloc_obj);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena Allocator API definitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity,
|
||||
@@ -40,10 +44,12 @@ void wapp_mem_arena_allocator_destroy(Allocator *allocator) {
|
||||
*allocator = (Allocator){0};
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena Allocator wrappers definitions
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
internal inline void *mem_arena_alloc(u64 size, void *alloc_obj) {
|
||||
@@ -57,4 +63,4 @@ internal inline void *mem_arena_alloc_aligned(u64 size, u64 alignment,
|
||||
return wapp_mem_arena_alloc_aligned(arena, size, alignment);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -11,7 +11,9 @@ extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena Allocator wrapper macros
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
#define wapp_mem_arena_allocator_init(base_capacity) \
|
||||
@@ -27,10 +29,12 @@ extern "C" {
|
||||
(wapp_mem_arena_allocator_init_custom( \
|
||||
base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, true))
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************/ //
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
////// Arena Allocator API declarations
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/***************************************************************************/ //
|
||||
|
||||
/**
|
||||
@@ -50,7 +54,7 @@ Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity,
|
||||
void wapp_mem_arena_allocator_clear(Allocator *allocator);
|
||||
void wapp_mem_arena_allocator_destroy(Allocator *allocator);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user