1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#![allow(missing_docs)]

use crate::{RuntimeLinearMemory, Store, VMMemoryDefinition, WaitResult};
use anyhow::{bail, Result};
use std::ops::Range;
use std::time::Instant;
use wasmtime_environ::{MemoryPlan, Trap};

#[derive(Clone)]
pub enum SharedMemory {}

impl SharedMemory {
    pub fn wrap(
        _plan: &MemoryPlan,
        _memory: Box<dyn RuntimeLinearMemory>,
        _ty: wasmtime_environ::Memory,
    ) -> Result<Self> {
        bail!("support for shared memories was disabled at compile time");
    }

    pub fn ty(&self) -> wasmtime_environ::Memory {
        match *self {}
    }

    pub fn as_memory(self) -> crate::Memory {
        match self {}
    }

    pub fn vmmemory_ptr(&self) -> *const VMMemoryDefinition {
        match *self {}
    }

    pub fn grow(
        &self,
        _delta_pages: u64,
        _store: Option<&mut dyn Store>,
    ) -> Result<Option<(usize, usize)>> {
        match *self {}
    }

    pub fn atomic_notify(&self, _addr_index: u64, _count: u32) -> Result<u32, Trap> {
        match *self {}
    }

    pub fn atomic_wait32(
        &self,
        _addr_index: u64,
        _expected: u32,
        _timeout: Option<Instant>,
    ) -> Result<WaitResult, Trap> {
        match *self {}
    }

    pub fn atomic_wait64(
        &self,
        _addr_index: u64,
        _expected: u64,
        _timeout: Option<Instant>,
    ) -> Result<WaitResult, Trap> {
        match *self {}
    }
}

impl RuntimeLinearMemory for SharedMemory {
    fn byte_size(&self) -> usize {
        match *self {}
    }

    fn maximum_byte_size(&self) -> Option<usize> {
        match *self {}
    }

    fn grow(
        &mut self,
        _delta_pages: u64,
        _store: Option<&mut dyn Store>,
    ) -> Result<Option<(usize, usize)>> {
        match *self {}
    }

    fn grow_to(&mut self, _size: usize) -> Result<()> {
        match *self {}
    }

    fn vmmemory(&mut self) -> VMMemoryDefinition {
        match *self {}
    }

    fn needs_init(&self) -> bool {
        match *self {}
    }

    fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
        match *self {}
    }

    fn wasm_accessible(&self) -> Range<usize> {
        match *self {}
    }
}