You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JWebAssembly does not used linear memory for data access. It is written for a GC. The linear memory contains only the class descriptions, string constants, etc. The program code that are not machine instructions.
JWebAssembly does not used linear memory for data access. It is written for a GC. The linear memory contains only the class descriptions, string constants, etc. The program code that are not machine instructions.
Via memory section you can only share pointers in a byte array. If your complex types are bytes in linear memory like in languages like C++ then this is valid. Java das not work with linear memory. The underlying memory manager of the VM can work with it. But this is a layer that JWebAssembly will not implement.
The target of JWebAssembly is the usage of a GC and there complex object will be share by reference.
Activity
Horcrux7 commentedon Apr 14, 2021
JWebAssembly does not used linear memory for data access. It is written for a GC. The linear memory contains only the class descriptions, string constants, etc. The program code that are not machine instructions.
zonghaishang commentedon Apr 15, 2021
Maybe I don’t understand it correctly, I found that the webassembly specification should include the memory section:
https://webassembly.github.io/spec/core/binary/modules.html#binary-memsec
At present, the exchange of complex types of data and the host can only be passed through the linear memory of wasm.
https://github.com/mosn/mosn/blob/ebd131fbfb2c6eae7d0926ee305ecdeba194e348/pkg/wasm/runtime/wasmer/instance.go#L363
Horcrux7 commentedon Apr 15, 2021
It can contain a memory section. It is optional. JWebAssembly use also a memory section but only for it internal data.
Via memory section you can only share pointers in a byte array. If your complex types are bytes in linear memory like in languages like C++ then this is valid. Java das not work with linear memory. The underlying memory manager of the VM can work with it. But this is a layer that JWebAssembly will not implement.
The target of JWebAssembly is the usage of a GC and there complex object will be share by reference.