diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 8e9b8193..e857b586 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -41,7 +41,8 @@ extern const object Cyc_EOF; object cell_get(object cell); -#define global_set(glo,value) (glo=value) +#define global_set(glo,value) Cyc_global_set(data, (object *)&glo, value) +object Cyc_global_set(void *thd, object *glo, object value); /* Variable argument count support diff --git a/runtime.c b/runtime.c index 4f7c18d5..840fc374 100644 --- a/runtime.c +++ b/runtime.c @@ -12,6 +12,16 @@ //int JAE_DEBUG = 0; //int gcMoveCountsDEBUG[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +TODO: still not good enough, need to be smarter when marking grey objs that are +still on the stack (??). see reg-port in read.sld + +object Cyc_global_set(void *thd, object *glo, object value) +{ + gc_mut_update((gc_thread_data *)thd, *glo, value); + *(glo) = value; + return value; +} + /* Error checking section - type mismatch, num args, etc */ /* Type names to use for error messages */ const char *tag_names[21] = { \