Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data-Structure ModuleTranslation depends on wasm-data liftetime #33

Open
frehberg opened this issue Nov 30, 2018 · 1 comment
Open

Data-Structure ModuleTranslation depends on wasm-data liftetime #33

frehberg opened this issue Nov 30, 2018 · 1 comment

Comments

@frehberg
Copy link
Contributor

The following function of is creating the ModuleTranslation from raw WASM-data

impl<'data, 'module> ModuleEnvironment<'data, 'module> {
   pub fn translate(mut self, data: &'data [u8]) -> WasmResult<ModuleTranslation<'data, 'module>> {};
}

Due to this, the raw-wasm data must outlive Translation/Compilation. This may cause double memory consumption, keeping the raw-wasm-data and translated/compiled representation in memory.

I would expect that after invocation of function translate, the raw WASM-data could be dropped/deleted to reduce memory consumption.

@sunfishcode
Copy link
Member

I agree, now that this code is becoming more concrete, it's becoming clear that we need to reorganize several of the key data structures.

I think this is the same basic situation as the other issue about InstanceWorld too. I'm going to take a look at factoring that better.

grishasobol pushed a commit to grishasobol/wasmtime that referenced this issue Nov 29, 2021
* Fix memory max pages

* Get rid of calculate_memory_size.
howjmay pushed a commit to howjmay/wasmtime that referenced this issue Jan 24, 2022
pchickey pushed a commit to pchickey/wasmtime that referenced this issue May 12, 2023
* Add basic TCP socket APIs.

This is based on @npmccullum's [wasi-snapshot-preview2 draft] which is
in turn based on the [wasi-sockets proposal], though for simplify for
now it omits UDP sockets and some other features.

It's also based on the [pseudo-streams PR]; so that should proceed
first before this.

[draft wasi-snapshot-preview2]: https://github.com/npmccallum/wasi-snapshot-preview2
[wasi-sockets proposal]: https://github.com/WebAssembly/wasi-sockets
[pseudo-streams PR]: bytecodealliance/preview2-prototyping#29
pchickey pushed a commit to pchickey/wasmtime that referenced this issue May 16, 2023
* Add basic TCP socket APIs.

This is based on @npmccullum's [wasi-snapshot-preview2 draft] which is
in turn based on the [wasi-sockets proposal], though for simplify for
now it omits UDP sockets and some other features.

It's also based on the [pseudo-streams PR]; so that should proceed
first before this.

[draft wasi-snapshot-preview2]: https://github.com/npmccallum/wasi-snapshot-preview2
[wasi-sockets proposal]: https://github.com/WebAssembly/wasi-sockets
[pseudo-streams PR]: bytecodealliance/preview2-prototyping#29
dhil pushed a commit to dhil/wasmtime that referenced this issue Jun 9, 2023
* do not set read_only flag when reading payloads

* re-enable cont_resume2 test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants