Open thewtex opened 1 year ago
Should we expect pipelines operating in such fashion to call into main()
? Or should we ccall into some other entrypoint we define? The former handles allocating args, while I'm not sure about the latter.
Yes, actors can allocate their own internal memory and manage their own internal state. For reasons of efficiency and safety, inputs and outputs are allocated, "lowered" and "lifted" by itk-wasm bindgen or, eventually, wit bindgen.
Update: I encountered the stack leak behavior in itk-wasm@1.0.0-b.141 when calling readImageBlob many times using the same webworker. I fixed it by patching the itk-image-io files to call stackSave/stackRestore inside callMain()
. I haven't evaluated this yet in VolView.
This mode would enable working with pipelines following the Actor Model in addition to use as a pure function.
For Emscripten:
stackSave
,stackRestore
, per https://github.com/emscripten-core/emscripten/commit/cc1112ad32d13a67fe2534a4e47e3177e736f95bactor: bool
torunPipeline
's options.stackSave
/stackPtr
per https://github.com/Kitware/VolView/pull/281/commits/7690cde3c3d12bf78fd096b7a5b604d55d5fdc96For WASI:
actor: boolean
option torun_pipeline
actor
for re-use -- the last positional output? The wasm runtimestore
?stackSave
andstackRestore
?