Skip to content

Ensure Unique Keys in @memoize Decorator #20218

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

Merged
merged 1 commit into from
Sep 10, 2023

Conversation

vikram-kangotra
Copy link
Contributor

Previously, the key used in the @memoize decorator was not unique. By including the method's arguments in the key, we now ensure that the key is unique for each call.

Fixes #20217

Previously, the key used in the @memoize decorator was
not unique. By including the method's arguments in the
key, we now ensure that the key is unique for each call.

Fixes emscripten-core#20217
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Although all this code is internal to emscripten.. its not really designed to be called by external code. What code are you writing that uses this?

vikram-kangotra added a commit to vikram-kangotra/emscripten that referenced this pull request Sep 10, 2023
In this commit, we introduce functionality to read strings from a custom section in WebAssembly modules.
This is crucial for enabling Rust code to work seamlessly with Emscripten, as Rust writes to custom sections rather than the em_asm section (emscripten-core#13838 (comment)).

The changes made in this commit include:
- The addition of the `get_wasm_custom_section` function, which retrieves custom sections by name from a WebAssembly module.
- Reading and parsing strings from the specified custom section.
- Storing the extracted strings in a dictionary for further processing.

This enhancement addresses an issue emscripten-core#13838 where Rust code interacts with Emscripten, and the ability to read strings from custom sections is necessary for proper integration.

This commit is a work in progress, as we still need to determine the correct offset value for the `string_key` variable.

Please note that this commit depends on the changes introduced in Merge Request emscripten-core#20218.
vikram-kangotra added a commit to vikram-kangotra/emscripten that referenced this pull request Sep 10, 2023
In this commit, we introduce functionality to read strings from a custom section in WebAssembly modules.
This is crucial for enabling Rust code to work seamlessly with Emscripten, as Rust writes to custom sections rather than the em_asm section (emscripten-core#13838 (comment)).

The changes made in this commit include:
- The addition of the `get_wasm_custom_section` function, which retrieves custom sections by name from a WebAssembly module.
- Reading and parsing strings from the specified custom section.
- Storing the extracted strings in a dictionary for further processing.

This enhancement addresses an issue emscripten-core#13838 where Rust code interacts with Emscripten, and the ability to read strings from custom sections is necessary for proper integration.

This commit is a work in progress, as we still need to determine the correct offset value for the `string_key` variable.

Please note that this commit depends on the changes introduced in Merge Request emscripten-core#20218.
vikram-kangotra added a commit to vikram-kangotra/emscripten that referenced this pull request Sep 10, 2023
In this commit, we introduce functionality to read strings from a custom section in WebAssembly modules.
This is crucial for enabling Rust code to work seamlessly with Emscripten, as Rust writes to custom sections rather than the em_asm section (emscripten-core#13838 (comment)).

The changes made in this commit include:
- The addition of the `get_wasm_custom_section` function, which retrieves custom sections by name from a WebAssembly module.
- Reading and parsing strings from the specified custom section.
- Storing the extracted strings in a dictionary for further processing.

This enhancement addresses an issue emscripten-core#13838 where Rust code interacts with Emscripten, and the ability to read strings from custom sections is necessary for proper integration.

This commit is a work in progress, as we still need to determine the correct offset value for the `string_key` variable.

Please note that this commit depends on the changes introduced in Merge Request emscripten-core#20218.
vikram-kangotra added a commit to vikram-kangotra/emscripten that referenced this pull request Sep 10, 2023
In this commit, we introduce functionality to read strings from a custom section in WebAssembly modules.
This is crucial for enabling Rust code to work seamlessly with Emscripten, as Rust writes to custom sections rather than the em_asm section (emscripten-core#13838 (comment)).

The changes made in this commit include:
- The addition of the `get_wasm_custom_section` function, which retrieves custom sections by name from a WebAssembly module.
- Reading and parsing strings from the specified custom section.
- Storing the extracted strings in a dictionary for further processing.

This enhancement addresses an issue emscripten-core#13838 where Rust code interacts with Emscripten, and the ability to read strings from custom sections is necessary for proper integration.

This commit is a work in progress, as we still need to determine the correct offset value for the `string_key` variable.

Please note that this commit depends on the changes introduced in Merge Request emscripten-core#20218.
@vikram-kangotra
Copy link
Contributor Author

It's required for this MR: #20219

vikram-kangotra added a commit to vikram-kangotra/emscripten that referenced this pull request Sep 10, 2023
In this commit, we introduce functionality to read strings from a custom section in WebAssembly modules.
This is crucial for enabling Rust code to work seamlessly with Emscripten, as Rust writes to custom sections rather than the em_asm section (emscripten-core#13838 (comment)).

The changes made in this commit include:
- The addition of the `get_wasm_custom_section` function, which retrieves custom sections by name from a WebAssembly module.
- Reading and parsing strings from the specified custom section.
- Storing the extracted strings in a dictionary for further processing.

This enhancement addresses an issue emscripten-core#13838 where Rust code interacts with Emscripten, and the ability to read strings from custom sections is necessary for proper integration.

This commit is a work in progress, as we still need to determine the correct offset value for the `string_key` variable.

Please note that this commit depends on the changes introduced in Merge Request emscripten-core#20218.
@sbc100 sbc100 merged commit 5da546c into emscripten-core:main Sep 10, 2023
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

Successfully merging this pull request may close these issues.

get_custom_section function in tools/webassembly.py returns inconsistent results
2 participants