smoldot
smoldot copied to clipboard
Use the allocator to allocate the input data in the VM
According to @pepyakin it's a bit ambiguous whether the input data is supposed to known to the allocator.
The main difficulty of this issue is that the allocator needs access to the memory of the Wasm in order to allocate, but in the current API this memory is only accessible after the VM has started, and in order for the VM to start we need to pass as input the pointer that the allocator has allocated. In other words, a snake biting its tail.
Before fixing this, we need to figure out whether the VM is supposed to clear its memory between runtime calls.