mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-31 04:39:28 +00:00
Move Webassembly objects to Store and remove Context
Co-authored-by: ptitSeb <sebastien.chev@gmail.com> Co-authored-by: Manos Pitsidianakis <manos@wasmer.io>
This commit is contained in:
committed by
Manos Pitsidianakis
parent
b5ae6399ce
commit
a419ccdf52
@ -12,8 +12,8 @@ const int iterations = 100000;
|
||||
int live_count = 0;
|
||||
|
||||
void finalize(void* data) {
|
||||
int i = (int)data;
|
||||
if (i % (iterations / 10) == 0) printf("Finalizing #%d...\n", i);
|
||||
intptr_t i = (intptr_t)data;
|
||||
if (i % (iterations / 10) == 0) printf("Finalizing #%" PRIdPTR "...\n", i);
|
||||
--live_count;
|
||||
}
|
||||
|
||||
@ -74,8 +74,6 @@ int main(int argc, const char* argv[]) {
|
||||
printf("Live count %d\n", live_count);
|
||||
printf("Creating store 1...\n");
|
||||
wasm_store_t* store1 = wasm_store_new(engine);
|
||||
wasm_context_t* ctx1 = wasm_context_new(store1, 0);
|
||||
wasm_store_context_set(store1, ctx1);
|
||||
|
||||
printf("Running in store 1...\n");
|
||||
run_in_store(store1);
|
||||
@ -83,8 +81,6 @@ int main(int argc, const char* argv[]) {
|
||||
|
||||
printf("Creating store 2...\n");
|
||||
wasm_store_t* store2 = wasm_store_new(engine);
|
||||
wasm_context_t* ctx2 = wasm_context_new(store2, 0);
|
||||
wasm_store_context_set(store2, ctx2);
|
||||
|
||||
printf("Running in store 2...\n");
|
||||
run_in_store(store2);
|
||||
|
Reference in New Issue
Block a user