Benchmarks are working, but empty

Lots of work and stress for a tint bit of progress.

See #131
This commit is contained in:
2024-10-19 15:57:07 +11:00
parent 787a1cca84
commit 5d37d06343
10 changed files with 159 additions and 1 deletions

View File

@@ -26,7 +26,18 @@ TOY_API Toy_Array* Toy_resizeArray(Toy_Array* array, unsigned int capacity);
#define TOY_ARRAY_ALLOCATE() Toy_resizeArray(NULL, TOY_ARRAY_INITIAL_CAPACITY)
#endif
//quick free
#ifndef TOY_ARRAY_FREE
#define TOY_ARRAY_FREE(array) Toy_resizeArray(array, 0)
#endif
//one line to expand the array
#ifndef TOY_ARRAY_EXPAND
#define TOY_ARRAY_EXPAND(array) (array = (array != NULL && (array)->count + 1 > (array)->capacity ? Toy_resizeArray(array, (array)-> capacity * TOY_ARRAY_EXPANSION_RATE) : array))
#endif
//quick push back
#ifndef TOY_ARRAY_PUSHBACK
#define TOY_ARRAY_PUSHBACK(array, value) (TOY_ARRAY_EXPAND(array),(array)->data[(array)->count++] = (value))
#endif