## Summary Standardize naming conventions across the entire wizapp-stdlib codebase by replacing inconsistent prefixes and snake_case with a unified `wp` prefix + CamelCase scheme. ## Changes ### Naming convention applied | Pattern | Before | After | |---|---|---| | Public functions | `wapp_module_function` | `wpModuleFunction` | | Public types | `GenericXxx`, bare `Xxx` | `WpXxx` | | Constants / enum values | `WAPP_XXX`, `SHELL_XXX` | `WP_XXX`, `WP_SHELL_XXX` | | Internal functions | `_module_function` | `_moduleFunction` | | Storage-class macros | `wapp_extern`, `wapp_intern` | `wp_extern`, `wp_intern` | ### Modules affected All 20 modules were renamed: `arena`, `array`, `dbl_list`, `queue`, `str8`, `mem_allocator`, `mem_utils`, `mem_os`, `file`, `cpath`, `log`, `shell_commander`, `shell_termcolour`, `shell_utils`, `prng/xorshift`, `uuid`, `tester`, `aliases`, `assert`, `misc_utils`, `platform` — plus their test files. ### Backward compatibility Added `src/oldnames.h` with `#define OLD_NAME NEW_NAME` for every renamed symbol, organized by module under Constants → Types → Functions sections. Existing code that includes this file will compile without changes. Reviewed-on: #12 Co-authored-by: Abdelrahman <said.abdelrahman89@gmail.com> Co-committed-by: Abdelrahman <said.abdelrahman89@gmail.com>
This commit was merged in pull request #12.
This commit is contained in:
@@ -8,39 +8,39 @@
|
||||
#include "../../../common/platform/platform.h"
|
||||
#include "../../../base/mem/allocator/mem_allocator.h"
|
||||
|
||||
#ifdef WAPP_PLATFORM_CPP
|
||||
#ifdef WP_PLATFORM_CPP
|
||||
BEGIN_C_LINKAGE
|
||||
#endif // !WAPP_PLATFORM_CPP
|
||||
#endif // !WP_PLATFORM_CPP
|
||||
|
||||
#define wapp_mem_arena_allocator_init(base_capacity) \
|
||||
(wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE, false))
|
||||
#define wapp_mem_arena_allocator_init_commit(base_capacity) \
|
||||
(wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, false))
|
||||
#define wapp_mem_arena_allocator_init_zero(base_capacity) \
|
||||
(wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE, true))
|
||||
#define wapp_mem_arena_allocator_init_commit_and_zero(base_capacity) \
|
||||
(wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE | WAPP_MEM_ALLOC_COMMIT, true))
|
||||
#define wpMemArenaAllocatorInit(base_capacity) \
|
||||
(wpMemArenaAllocatorInitCustom(base_capacity, WP_MEM_ALLOC_RESERVE, false))
|
||||
#define wpMemArenaAllocatorInitCommit(base_capacity) \
|
||||
(wpMemArenaAllocatorInitCustom(base_capacity, WP_MEM_ALLOC_RESERVE | WP_MEM_ALLOC_COMMIT, false))
|
||||
#define wpMemArenaAllocatorInitZero(base_capacity) \
|
||||
(wpMemArenaAllocatorInitCustom(base_capacity, WP_MEM_ALLOC_RESERVE, true))
|
||||
#define wpMemArenaAllocatorInitCommitAndZero(base_capacity) \
|
||||
(wpMemArenaAllocatorInitCustom(base_capacity, WP_MEM_ALLOC_RESERVE | WP_MEM_ALLOC_COMMIT, true))
|
||||
|
||||
/**
|
||||
* Wraps an Arena in an Allocator object. It attempts to initialise the Arena
|
||||
* Wraps a WpArena in a WpAllocator object. It attempts to initialise the WpArena
|
||||
* and, if successful, defines the operations supported by it to be used by the
|
||||
* Allocator.
|
||||
* WpAllocator.
|
||||
*
|
||||
* An Arena allocator only supports normal allocation and aligned allocation.
|
||||
* An WpArena allocator only supports normal allocation and aligned allocation.
|
||||
* Reallocation, aligned reallocation and freeing aren't implemented.
|
||||
*
|
||||
* The `wapp_mem_arena_allocator_init_custom` provides the most control over how
|
||||
* the Arena is initialised. Wrapper macros are provided for easier use.
|
||||
* The `wpMemArenaAllocatorInitCustom` provides the most control over how
|
||||
* the WpArena is initialised. Wrapper macros are provided for easier use.
|
||||
*/
|
||||
Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity, MemAllocFlags flags, b8 zero_buffer);
|
||||
Allocator wapp_mem_arena_allocator_init_with_buffer(u8 *buffer, u64 buffer_size);
|
||||
void wapp_mem_arena_allocator_temp_begin(const Allocator *allocator);
|
||||
void wapp_mem_arena_allocator_temp_end(const Allocator *allocator);
|
||||
void wapp_mem_arena_allocator_clear(Allocator *allocator);
|
||||
void wapp_mem_arena_allocator_destroy(Allocator *allocator);
|
||||
WpAllocator wpMemArenaAllocatorInitCustom(u64 base_capacity, WpMemAllocFlags flags, b8 zero_buffer);
|
||||
WpAllocator wpMemArenaAllocatorInitWithBuffer(u8 *buffer, u64 buffer_size);
|
||||
void wpMemArenaAllocatorTempBegin(const WpAllocator *allocator);
|
||||
void wpMemArenaAllocatorTempEnd(const WpAllocator *allocator);
|
||||
void wpMemArenaAllocatorClear(WpAllocator *allocator);
|
||||
void wpMemArenaAllocatorDestroy(WpAllocator *allocator);
|
||||
|
||||
#ifdef WAPP_PLATFORM_CPP
|
||||
#ifdef WP_PLATFORM_CPP
|
||||
END_C_LINKAGE
|
||||
#endif // !WAPP_PLATFORM_CPP
|
||||
#endif // !WP_PLATFORM_CPP
|
||||
|
||||
#endif // !MEM_ARENA_ALLOCATOR_H
|
||||
|
||||
Reference in New Issue
Block a user