summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-24 21:34:51 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-06-24 21:34:51 +0300
commit939c2e7f448fbe6b44d0079d2fc33c7ac7eb32d0 (patch)
tree75a94041080473283d3e7c01013e27a1d2d49efd /unix
parent3c9b24bebeb573d10c1187fcf40ec1e1bb1bd7f2 (diff)
parentde5ce6d4613093f06de34746e865b32bcc243dd9 (diff)
downloadmicropython-939c2e7f448fbe6b44d0079d2fc33c7ac7eb32d0.tar.gz
micropython-939c2e7f448fbe6b44d0079d2fc33c7ac7eb32d0.zip
Merge pull request #690 from stinos/msvc-gc
msvc: Enable GC
Diffstat (limited to 'unix')
-rw-r--r--unix/gccollect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/unix/gccollect.c b/unix/gccollect.c
index 1014a2629b..f24cc52495 100644
--- a/unix/gccollect.c
+++ b/unix/gccollect.c
@@ -130,8 +130,11 @@ void gc_collect(void) {
gc_collect_start();
// this traces the .bss section
-#ifdef __CYGWIN__
+#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
@@ -141,7 +144,8 @@ void gc_collect(void) {
regs_t regs;
gc_helper_get_regs(regs);
// GC stack (and regs because we captured them)
- gc_collect_root((void**)&regs, ((machine_uint_t)stack_top - (machine_uint_t)&regs) / sizeof(machine_uint_t));
+ void **regs_ptr = (void**)(void*)&regs;
+ gc_collect_root(regs_ptr, ((machine_uint_t)stack_top - (machine_uint_t)&regs) / sizeof(machine_uint_t));
gc_collect_end();
//printf("-----\n");