Commit Graph

53 Commits

Author SHA1 Message Date
ptitSeb
b2170e3e4f Fix Wait/Notify opcode, the waiters hashmap is now on the Memory itself (#3723)
* Fix Wait/Notify opcode, the waiters hashmap is now on the Memory itself

* Refactored for clarity

* Use WAIT_ERROR everywhere

* Change from WAIT_ERROR to Option

* Added some unit test for threadconditions

* Switch from `Mutex<HashMap<...>>` to `DashMap<...>` for the NotifyMap

* Use FnvHasher for Dashmap

* Change timeout value in unit test to leave more margin to the system to react.

* Consolidate code, avoid duplication

* Put test in a test module

* Use an Result with custom error instead of an option for waiter
2023-04-13 15:36:41 +00:00
Christoph Herzog
9c12b87eb0 Rename fork() to duplicate()
Renames all the memory fork() functions to duplicate(),
since this is what they actually do.

They enable forking, but that is a seprate functionality.
2022-12-19 18:04:00 +01:00
Christoph Herzog
5109a407c4 WASIX Preparation
This commit extracts changes to core libraries made in the WASIX branch.

It is not reasonable to extract the partial commit history, so this is
just a batch commit.

The history will make a bit more sense again if we decide to merge the
WASIX branch with full commit history.
2022-12-16 11:47:04 +01:00
ptitSeb
ffd6d6b140 Merge branch 'master' into feat_sharedmemory 2022-11-24 15:56:32 +01:00
ptitSeb
04a03fc524 Fixed clippy warning on using Self 2022-11-22 14:38:25 +01:00
John Sharratt's Shared Account
a5f641b4b0 Implemented shared memory for Wasmer in preparation for multithreading
Fixed linter

Fixed clippy

Cleaned up some merge leftover
2022-11-22 14:11:32 +01:00
Syrus Akbary
0a1a71fd6e Revert #3145
This reverst buggy commit e1e08f44b7
2022-11-21 11:09:19 -08:00
Felix Schütt
641246bebc Merge branch 'master' into fix-3197 2022-10-17 16:16:04 +02:00
Felix Schütt
e6f6e6047a Fix wrong doc comment 2022-10-14 15:59:17 +02:00
Felix Schütt
b645800ae3 Fix runtime size for Memory 2022-10-14 14:39:24 +02:00
Felix Schütt
ad1f4fea05 cargo fmt 2022-10-14 14:12:52 +02:00
Felix Schütt
607050641c Added get_runtime_size to test for runtime-sizes of imports 2022-10-14 14:08:25 +02:00
Felix Schütt
67d650146c cargo clippy --fix 2022-10-14 13:00:55 +02:00
ptitSeb
50eed71ab0 Last changes to enforce size check on ther caller of memory_data_init and not the function itself 2022-10-06 09:51:54 +02:00
ptitSeb
57652b0585 Fixed initialize_with_data not always called, and made the default memory data initializer available outside of the crate 2022-10-05 14:35:40 +02:00
ptitSeb
c27547e41e Removed Instance::new_no_memory_init, use custom LinearMemory with custom memory_init method to get the same result 2022-10-04 14:48:51 +02:00
ptitSeb
2953093fb1 Some more cleanup 2022-08-23 11:28:43 +02:00
ptitSeb
73844bb7d2 Move LinearMemory test from vm::Memory to Tunables 2022-08-22 15:01:28 +02:00
ptitSeb
12eea42187 Added some test for LinearMemory trait 2022-08-22 13:43:10 +02:00
ptitSeb
553745cd3d Move LinearMemory trait and VMMemoryDefinition to wasmer_vm (from wasmer_types) 2022-08-19 16:00:38 +02:00
ptitSeb
7db6d3de78 Made clippy happy 2022-08-18 17:40:32 +02:00
ptitSeb
f599df0240 Fix linter 2022-08-18 16:58:04 +02:00
John Sharratt's Shared Account
c7c1507b8b Implemented LinearMemory trait 2022-08-18 16:53:37 +02:00
Felix Schütt
520314bbf0 Fix errors from "make lint" 2022-08-05 15:40:32 +02:00
Syrus Akbary
a419ccdf52 Move Webassembly objects to Store and remove Context
Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
Co-authored-by: Manos Pitsidianakis <manos@wasmer.io>
2022-07-19 15:31:51 +03:00
Amanieu d'Antras
738a66f719 Implement the new Context API for the core API
Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
2022-07-19 15:31:51 +03:00
Wolfgang Silbermayr
5339f7cdae Fix clippy lints
Fixes: #2926
2022-06-09 16:05:53 +02:00
Manos Pitsidianakis
00f9a3c8d7 Remove loupe dependency
Closes #2731
Closes #2744
2022-06-08 14:12:49 +03:00
ptitSeb
0c7ea79bfc Cleanup:
Removed conditionnal toml on wasm for VM as it's not builded in that configuration
Added unwind to wasm build
Moved Trap back to vm (from types) as it's used only on Runtime
Move MemoryError back to vm (from types) as it's used on Runtime only scenario
Some cleanup and lint fixes
Removed wasm build case from vfs/host_fs as it's not used
2022-05-03 09:34:13 +02:00
ptitSeb
e745ceab7a Moved TableStyle and MemoryStyle to wasmer-types (and compiler-single pass do not depend from vm anymore) 2022-05-03 09:32:34 +02:00
Mark McCaskey
97c4a03e67 Recompute Memory::ty, make it return by value
This is a requirement of the updated `imports.wast` spectest
2021-05-05 07:50:35 -07:00
Bo Yao
dadc81296a cargo fmt 2021-04-21 16:06:12 -07:00
Bo Yao
24bcc9349e cargo fmt 2021-04-21 15:42:47 -07:00
Bo Yao
3c19a663a9 merge master 2021-03-23 15:42:54 -07:00
Ivan Enderlin
03486f3b8a feat: Use latest version of loupe. 2021-03-23 13:04:45 +01:00
Ivan Enderlin
44dc884260 feat: Start implementing loupe::MemoryUsage on wasmer::Module. 2021-03-23 13:04:45 +01:00
Bo Yao
204c37ce8e cargo fmt 2021-03-22 17:10:12 -07:00
Bo Yao
eb081f3282 make lib/vm depend on rkyv as optional 2021-03-22 15:46:27 -07:00
Bo Yao
db93663294 fix rkyv compilation errors 2021-03-16 16:27:44 -07:00
Nick Lewycky
91d399e8f4 Apply cleanups proposed by clippy. 2021-01-26 16:02:22 -08:00
Simon Warta
59fb850181 Handle overflow errors in Bytes -> Pages conversion 2020-12-10 18:02:48 +01:00
Mark McCaskey
c5b6d9fa8f Abstract over metadata ownership in Memory/Table fn impls 2020-10-19 15:07:34 -07:00
Mark McCaskey
9fdbb0886c Split memory, table creation. Mark unsafe functions unsafe 2020-10-15 15:42:54 -07:00
Mark McCaskey
de79a408ee Merge branch 'master' into feature/add-table-example 2020-10-14 16:31:25 -07:00
Mark McCaskey
49fe1734b3 Fix local table ownership issue 2020-10-14 16:12:35 -07:00
Mark McCaskey
4fc8ace118 Fix local memory ownership issue -- WIP
This commit contains a ton of debug code that we'll need to remove
2020-10-14 15:15:50 -07:00
Nick Lewycky
2a52e1f1b8 Simplify this code using ok_or instead of ok_or_else.
https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
2020-10-08 19:55:00 -07:00
Nick Lewycky
804204dfdb Use copy instead of clone.
https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
2020-10-08 19:52:41 -07:00
Mark McCaskey
ab153fc642 Improve error messages around memory creation 2020-10-05 15:45:52 -07:00
Nick Lewycky
8a27a2938b Turn VMMemoryDefinition::current_length into a u32.
The current wasm spec limits the size to 32-bits, and attempting to use a larger size causes problems with compiler-cranelift.
2020-08-19 18:04:12 -07:00