mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Toy_VM and Toy_Stack are working and tested, read more
At this point, only a minimal number of operations are working, and after running any kind of source code, the 'result' is simply left on the VM's stack. Still, it's awesome to see it reach this point.
This commit is contained in:
@@ -40,7 +40,7 @@ void Toy_pushStack(Toy_Stack* stack, Toy_Value value) {
|
||||
//expand the capacity if needed
|
||||
if (stack->count + 1 > stack->capacity) {
|
||||
int oldCapacity = stack->capacity;
|
||||
stack->capacity = TOY_GROW_CAPACITY(stack->capacity);
|
||||
stack->capacity = stack->capacity < MIN_SIZE ? MIN_SIZE : stack->capacity * 2; //similar to TOY_GROW_CAPACITY, with a bigger initial size
|
||||
stack->ptr = TOY_GROW_ARRAY(Toy_Value, stack->ptr, oldCapacity, stack->capacity);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user