diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2014-07-13 12:18:16 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2014-07-13 12:29:48 +0400 |
commit | 4eaea0afad5dfd31d1d800138f5afaca1925c775 (patch) | |
tree | 72c42c450fc3219ec259763c0695ddea15aaa0b2 /mark_rts.c | |
parent | 7d2905e01d7f9831353e1f034aea3692e71f96fc (diff) | |
download | bdwgc-4eaea0afad5dfd31d1d800138f5afaca1925c775.tar.gz |
Code refactoring of Emscripten platform support (single-threaded)
* alloc.c (min_bytes_allocd): Test STACK_NOT_SCANNED macro instead
of __EMSCRIPTEN__ (stack size to scan is zero if STACK_NOT_SCANNED).
* include/private/gcconfig.h (ALIGNMENT): Remove duplicate definition
for _EMSCRIPTEN__.
* include/private/gcconfig.h (STACK_NOT_SCANNED): New macro defined
for __EMSCRIPTEN__ target (in addition to OS_TYPE, CPP_WORDSZ,
ALIGNMENT, DATASTART, DATAEND).
* mach_dep.c (GC_push_regs): Test STACK_NOT_SCANNED macro instead
of __EMSCRIPTEN__ (push nothing if STACK_NOT_SCANNED).
* mark_rts.c (GC_push_roots): Test STACK_NOT_SCANNED macro instead
of __EMSCRIPTEN__ (do not call GC_push_regs_and_stack if
STACK_NOT_SCANNED); mark cold_gc_frame argument as potentially unused.
* misc.c (GC_clear_stack): Test STACK_NOT_SCANNED macro instead
of __EMSCRIPTEN__ (do not clear stack if STACK_NOT_SCANNED).
* misc.c (GC_clear_stack): Reformat code.
Diffstat (limited to 'mark_rts.c')
-rw-r--r-- | mark_rts.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -751,7 +751,7 @@ STATIC void GC_push_regs_and_stack(ptr_t cold_gc_frame) * A zero value indicates that it's OK to miss some * register values. */ -GC_INNER void GC_push_roots(GC_bool all, ptr_t cold_gc_frame) +GC_INNER void GC_push_roots(GC_bool all, ptr_t cold_gc_frame GC_ATTR_UNUSED) { int i; unsigned kind; @@ -810,9 +810,9 @@ GC_INNER void GC_push_roots(GC_bool all, ptr_t cold_gc_frame) * This is usually done by saving the current context on the * stack, and then just tracing from the stack. */ -#ifndef __EMSCRIPTEN__ - GC_push_regs_and_stack(cold_gc_frame); -#endif +# ifndef STACK_NOT_SCANNED + GC_push_regs_and_stack(cold_gc_frame); +# endif if (GC_push_other_roots != 0) (*GC_push_other_roots)(); /* In the threads case, this also pushes thread stacks. */ |