diff options
Diffstat (limited to 'stm/gccollect.c')
-rw-r--r-- | stm/gccollect.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stm/gccollect.c b/stm/gccollect.c index c0f67ac0d5..cea0bc56eb 100644 --- a/stm/gccollect.c +++ b/stm/gccollect.c @@ -13,10 +13,10 @@ void gc_helper_get_regs_and_clean_stack(machine_uint_t *regs, machine_uint_t hea void gc_collect(void) { uint32_t start = sys_tick_counter; gc_collect_start(); - gc_collect_root((void**)&_ram_start, ((uint32_t)&_heap_start - (uint32_t)&_ram_start) / 4); + gc_collect_root((void**)&_ram_start, (&_heap_start - &_ram_start) / 4); machine_uint_t regs[10]; - gc_helper_get_regs_and_clean_stack(regs, HEAP_END); - gc_collect_root((void**)HEAP_END, (RAM_END - HEAP_END) / 4); // will trace regs since they now live in this function on the stack + gc_helper_get_regs_and_clean_stack(regs, (machine_uint_t)&_heap_end); + gc_collect_root((void**)&_heap_end, (&_ram_end - &_heap_end) / 4); // will trace regs since they now live in this function on the stack gc_collect_end(); uint32_t ticks = sys_tick_counter - start; // TODO implement a function that does this properly |