diff options
author | Yuta Saito <[email protected]> | 2022-01-15 23:57:14 +0900 |
---|---|---|
committer | Yuta Saito <[email protected]> | 2022-01-19 11:19:06 +0900 |
commit | e7fb1fa0414a0c6e43796052c877f317e8e09846 (patch) | |
tree | b0cbf45852a04853d42eb190b92e1f460600f06c /gc.c | |
parent | 23de01c7aa5d8f3651213b75295a4969a187a041 (diff) |
[wasm] gc.c: disable read signal barrier for wasi
WASI currently does not yet support signal
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5407
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -5013,6 +5013,14 @@ gc_unprotect_pages(rb_objspace_t *objspace, rb_heap_t *heap) static void gc_update_references(rb_objspace_t * objspace); static void invalidate_moved_page(rb_objspace_t *objspace, struct heap_page *page); +#if !defined(__wasi__) +// read barrier for pages containing MOVED objects +# define GC_ENABLE_READ_SIGNAL_BARRIER 1 +#else +# define GC_ENABLE_READ_SIGNAL_BARRIER 0 +#endif + +#if GC_ENABLE_READ_SIGNAL_BARRIER static void read_barrier_handler(uintptr_t address) { @@ -5121,6 +5129,8 @@ install_handlers(void) } #endif +#endif // GC_ENABLE_READ_SIGNAL_BARRIER + static void revert_stack_objects(VALUE stack_obj, void *ctx) { @@ -5167,7 +5177,9 @@ gc_compact_finish(rb_objspace_t *objspace, rb_size_pool_t *pool, rb_heap_t *heap gc_unprotect_pages(objspace, heap); } +#if GC_ENABLE_READ_SIGNAL_BARRIER uninstall_handlers(); +#endif /* The mutator is allowed to run during incremental sweeping. T_MOVED * objects can get pushed on the stack and when the compaction process @@ -5889,7 +5901,9 @@ gc_compact_start(rb_objspace_t *objspace) memset(objspace->rcompactor.moved_count_table, 0, T_MASK * sizeof(size_t)); /* Set up read barrier for pages containing MOVED objects */ +#if GC_ENABLE_READ_SIGNAL_BARRIER install_handlers(); +#endif } static void |