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

Remove use of shared mutable static #854

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

jeffcharles
Copy link
Collaborator

Description of the change

Changes the codegen module to use an immutable static OnceLock for a MemoryInputPipe instead of a mutable static OnceLock on the WasiCtx. This shouldn't have any functional impact on the CLI. Integration test time increased from 51.04 seconds to 51.94 seconds which seems like a minor increase considering the number of tests involved.

Why am I making this change?

Using shared mutable statics in Rust is very discouraged. We had to disable a lint rule to allow this use. We also can remove some unsafe blocks too.

Checklist

  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli and javy-plugin do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.

@jeffcharles jeffcharles merged commit f576f4a into main Dec 5, 2024
4 checks passed
@jeffcharles jeffcharles deleted the jc.remove-one-shared-mutable-static-ref branch December 5, 2024 14:33
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.

2 participants