mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Tests are passing, added preserveScope to VM API
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
//utils
|
||||
static void expand(Toy_ModuleBundle* bundle, unsigned int amount) {
|
||||
if (bundle->count + amount > bundle->capacity) {
|
||||
bundle->capacity = 0;
|
||||
bundle->capacity = 8; //DON'T bitshift zero
|
||||
|
||||
while (bundle->count + amount > bundle->capacity) { //expand as much as needed
|
||||
bundle->capacity >>= 2;
|
||||
bundle->capacity <<= 2;
|
||||
}
|
||||
|
||||
bundle->ptr = realloc(bundle->ptr, bundle->capacity);
|
||||
|
||||
Reference in New Issue
Block a user