wasmer/entities/memory/
location.rs1use crate::error::AtomicsError;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
5pub struct MemoryLocation {
6 pub(crate) address: u32,
10}
11
12impl MemoryLocation {
13 pub fn new_32(address: u32) -> Self {
15 Self { address }
16 }
17}
18
19impl From<u32> for MemoryLocation {
20 fn from(value: u32) -> Self {
21 Self::new_32(value)
22 }
23}
24
25pub(crate) trait SharedMemoryOps {
27 fn disable_atomics(&self) -> Result<(), AtomicsError> {
29 Err(AtomicsError::Unimplemented)
30 }
31
32 fn wake_all_atomic_waiters(&self) -> Result<(), AtomicsError> {
34 Err(AtomicsError::Unimplemented)
35 }
36
37 fn notify(&self, _dst: MemoryLocation, _count: u32) -> Result<u32, AtomicsError> {
39 Err(AtomicsError::Unimplemented)
40 }
41
42 fn wait(
44 &self,
45 _dst: MemoryLocation,
46 _timeout: Option<std::time::Duration>,
47 ) -> Result<u32, AtomicsError> {
48 Err(AtomicsError::Unimplemented)
49 }
50}