mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Reworking structures for easy testing, read more
I was reworking bits of the containers to address issue #131, then realized that the table's tests depended on a specific initial size. I'm too buggered to finish it tonight, so I'll fix it tomorrow.
This commit is contained in:
@@ -27,3 +27,17 @@ TOY_API void Toy_removeTable(Toy_Table** tableHandle, Toy_Value key);
|
||||
|
||||
//NOTE: exposed to skip unnecessary allocations within Toy_Scope
|
||||
TOY_API Toy_Table* Toy_private_adjustTableCapacity(Toy_Table* oldTable, unsigned int newCapacity);
|
||||
|
||||
//some useful sizes, could be swapped out as needed
|
||||
#ifndef TOY_TABLE_INITIAL_CAPACITY
|
||||
#define TOY_TABLE_INITIAL_CAPACITY 8
|
||||
#endif
|
||||
|
||||
#ifndef TOY_TABLE_EXPANSION_RATE
|
||||
#define TOY_TABLE_EXPANSION_RATE 2
|
||||
#endif
|
||||
|
||||
//expand when the contents passes a certain percentage of the capacity
|
||||
#ifndef TOY_TABLE_EXPANSION_THRESHOLD
|
||||
#define TOY_TABLE_EXPANSION_THRESHOLD 0.8
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user