Generic dynamic arrays with type safety, optional sorting, and automatic growth.
Key Features:
- Type-safe generic programming through runtime type system
- Optional sorted mode with O(log n) binary search
- Configurable growth strategies for performance tuning
- Reference or value semantics for pointer types
- Automatic memory management with proper element destruction
Basic Usage:
sa_int32 arr = { 0 };
int32 idx =
saFind(arr, int32, 42);
#define saDestroy(handle)
#define saInit(out, type, capacity,...)
#define saFind(ref, type, elem,...)
#define saPush(handle, type, elem,...)
Sorted Arrays:
sa_int32 sorted = { 0 };
int32 idx =
saFind(sorted, int32, 20);
@ SA_Sorted
Maintain sorted order with O(log n) search and O(n) insert.