summaryrefslogtreecommitdiff
path: root/stm/gccollect.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-29 19:04:59 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-29 19:04:59 +0000
commit0347fbd2d541d6ede7d281e0b2f8c79d56c5f8be (patch)
tree70a8d4f03d1aed855276ad046093a3b6dafe58bd /stm/gccollect.c
parent08d075592f3fa958ac3f24e176bee5ab56e78f49 (diff)
parentbfb01e9da620d974e3e38bf7ea2aa22d9c527d9d (diff)
Merge branch 'master' of github.com:iabdalkader/micropython
Diffstat (limited to 'stm/gccollect.c')
-rw-r--r--stm/gccollect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stm/gccollect.c b/stm/gccollect.c
index c0f67ac0d..cea0bc56e 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