1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 23:23:07 +00:00

Use 32 bit unsigned integers for stackframes.

This commit is contained in:
Calvin Rose
2017-04-25 12:26:58 -04:00
parent 1d7f42ba01
commit 14f8b12706
3 changed files with 22 additions and 15 deletions

View File

@@ -417,9 +417,9 @@ int gst_run(Gst *vm, GstValue callee) {
}
/* Get an argument from the stack */
GstValue gst_arg(Gst *vm, uint16_t index) {
GstValue gst_arg(Gst *vm, uint32_t index) {
GstValue *stack = gst_thread_stack(vm->thread);
uint16_t frameSize = gst_frame_size(stack);
uint32_t frameSize = gst_frame_size(stack);
if (frameSize <= index) {
GstValue ret;
ret.type = GST_NIL;
@@ -429,15 +429,15 @@ GstValue gst_arg(Gst *vm, uint16_t index) {
}
/* Put a value on the stack */
void gst_set_arg(Gst* vm, uint16_t index, GstValue x) {
void gst_set_arg(Gst* vm, uint32_t index, GstValue x) {
GstValue *stack = gst_thread_stack(vm->thread);
uint16_t frameSize = gst_frame_size(stack);
uint32_t frameSize = gst_frame_size(stack);
if (frameSize <= index) return;
stack[index] = x;
}
/* Get the size of the VMStack */
uint16_t gst_count_args(Gst *vm) {
uint32_t gst_count_args(Gst *vm) {
GstValue *stack = gst_thread_stack(vm->thread);
return gst_frame_size(stack);
}