File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11import { main } from "@ruby/wasm-wasi/dist/browser.script"
22import * as pkg from "../package.json"
33
4- main ( pkg )
4+ main ( pkg , {
5+ env : {
6+ // WORKAROUND(katei): setjmp consumes a LOT of stack in Ruby 3.2,
7+ // so we extend default Fiber stack size as well as main stack
8+ // size allocated by wasm-ld's --stack-size. 8MB is enough for
9+ // most cases. See https://github.com/ruby/ruby.wasm/issues/273
10+ "RUBY_FIBER_MACHINE_STACK_SIZE" : "8388608"
11+ }
12+ } )
Original file line number Diff line number Diff line change 11import { DefaultRubyVM } from "./browser" ;
22
3- export const main = async ( pkg : { name : string ; version : string } ) => {
3+ export const main = async (
4+ pkg : { name : string ; version : string } ,
5+ options ?: Parameters < typeof DefaultRubyVM > [ 1 ] ,
6+ ) => {
47 const response = fetch (
58 `https://cdn.jsdelivr.net/npm/${ pkg . name } @${ pkg . version } /dist/ruby+stdlib.wasm` ,
69 ) ;
710 const module = await compileWebAssemblyModule ( response ) ;
8- const { vm } = await DefaultRubyVM ( module ) ;
11+ const { vm } = await DefaultRubyVM ( module , options ) ;
912
1013 vm . printVersion ( ) ;
1114
You can’t perform that action at this time.
0 commit comments