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

refactor: remove unused INSTNACE_CACHE #296

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

loloicci
Copy link
Contributor

Description

INSTANCE_CACHE is a thread-local variable used in some tests for old dynamic link way.

thread_local! {
// INSTANCE_CACHE and MODULE_CACHE are intended to replace wasmvm's cache layer in the mock.
// Unlike wasmvm, you have to initialize them yourself in the place where you test the dynamic call.
pub static INSTANCE_CACHE: RwLock<HashMap<String, RefCell<MockInstance>>> = RwLock::new(HashMap::new());
pub static MODULE_CACHE: RwLock<HashMap<String, RefCell<Module>>> = RwLock::new(HashMap::new());
}

But, it is not used after #273. So This should be removed.

Closes #295

Types of changes

  • Bug fix (changes which fixes an issue)
  • New feature (changes which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ETC (build, ci, docs, perf, refactor, style, test)

Checklist

@loloicci loloicci self-assigned this Apr 20, 2023
@loloicci loloicci added the dynamic_link relate the dynamic link call feature label Apr 20, 2023
@dudong2
Copy link

dudong2 commented Apr 24, 2023

INSTANCE_CACHE is being used in packages/vm/benches/main.rs. However, it hasn't been removed in this PR. I think it didn't throw an error because the benchmark doesn't work in CI.

@loloicci
Copy link
Contributor Author

loloicci commented Apr 25, 2023

@dudong2 Thank you for finding it. Fixing for the benchmark is done in #294 and it contains other fixes. So if we remove INSTANCE_CACHE from vm::benches::main, the benchmark will fail. So, I will leave the fix of the benchmark including removing INSTANCE_CACHE at #294.

@loloicci loloicci merged commit 00f58c0 into Finschia:dynamic_link Apr 25, 2023
@loloicci loloicci deleted the remove-instance-cache branch April 25, 2023 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamic_link relate the dynamic link call feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants