diff options
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -486,3 +486,20 @@ void unmark(void) } } } + +/* + * This function does nothing. + * gc_hint(x) just takes the address of local variable x + * and passes it to this function. This prevents the compiler + * from caching the value across function calls. + * This is needed for situations where + * - a compiler caches a variable in a register, but not entirely (the variable + * has a backing memory location); and + * - that location contains a stale old value of the variable, which cannot be + * garbage-collected as a result; and + * - this causes a problem, like unbounded memory growth. + */ +void gc_hint_func(val *val) +{ + (void) val; +} |