summaryrefslogtreecommitdiff
path: root/unix/gccollect.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/gccollect.c')
-rw-r--r--unix/gccollect.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/unix/gccollect.c b/unix/gccollect.c
index ab20220d3..f8bcbf965 100644
--- a/unix/gccollect.c
+++ b/unix/gccollect.c
@@ -26,6 +26,7 @@
#include <stdio.h>
+#include "py/mpstate.h"
#include "py/gc.h"
#if MICROPY_ENABLE_GC
@@ -127,23 +128,11 @@ void gc_collect(void) {
//gc_dump_info();
gc_collect_start();
- // this traces the .bss section
-#if defined( __CYGWIN__ )
-#define BSS_START __bss_start__
-#elif defined( _MSC_VER ) || defined( __MINGW32__ )
-#define BSS_START *bss_start
-#define _end *bss_end
-#else
-#define BSS_START __bss_start
-#endif
- extern char BSS_START, _end;
- //printf(".bss: %p-%p\n", &BSS_START, &_end);
- gc_collect_root((void**)&BSS_START, ((mp_uint_t)&_end - (mp_uint_t)&BSS_START) / sizeof(mp_uint_t));
regs_t regs;
gc_helper_get_regs(regs);
// GC stack (and regs because we captured them)
void **regs_ptr = (void**)(void*)&regs;
- gc_collect_root(regs_ptr, ((mp_uint_t)stack_top - (mp_uint_t)&regs) / sizeof(mp_uint_t));
+ gc_collect_root(regs_ptr, ((mp_uint_t)MP_STATE_VM(stack_top) - (mp_uint_t)&regs) / sizeof(mp_uint_t));
gc_collect_end();
//printf("-----\n");