@@ -78,11 +78,13 @@ use crate::prelude::*;
78
78
use crate :: runtime:: vm:: vmcontext:: VMMemoryDefinition ;
79
79
#[ cfg( has_virtual_memory) ]
80
80
use crate :: runtime:: vm:: { HostAlignedByteCount , MmapOffset } ;
81
- use crate :: runtime:: vm:: { MemoryImage , MemoryImageSlot , SendSyncPtr , VMStore , WaitResult } ;
81
+ use crate :: runtime:: vm:: { MemoryImage , MemoryImageSlot , SendSyncPtr , VMStore } ;
82
82
use alloc:: sync:: Arc ;
83
- use core:: time:: Duration ;
84
83
use core:: { ops:: Range , ptr:: NonNull } ;
85
- use wasmtime_environ:: { Trap , Tunables } ;
84
+ use wasmtime_environ:: Tunables ;
85
+
86
+ #[ cfg( feature = "threads" ) ]
87
+ use wasmtime_environ:: Trap ;
86
88
87
89
#[ cfg( has_virtual_memory) ]
88
90
mod mmap;
@@ -434,6 +436,7 @@ impl Memory {
434
436
}
435
437
436
438
/// Implementation of `memory.atomic.notify` for all memories.
439
+ #[ cfg( feature = "threads" ) ]
437
440
pub fn atomic_notify ( & mut self , addr : u64 , count : u32 ) -> Result < u32 , Trap > {
438
441
match self . as_shared_memory ( ) {
439
442
Some ( m) => m. atomic_notify ( addr, count) ,
@@ -445,12 +448,13 @@ impl Memory {
445
448
}
446
449
447
450
/// Implementation of `memory.atomic.wait32` for all memories.
451
+ #[ cfg( feature = "threads" ) ]
448
452
pub fn atomic_wait32 (
449
453
& mut self ,
450
454
addr : u64 ,
451
455
expected : u32 ,
452
- timeout : Option < Duration > ,
453
- ) -> Result < WaitResult , Trap > {
456
+ timeout : Option < core :: time :: Duration > ,
457
+ ) -> Result < crate :: WaitResult , Trap > {
454
458
match self . as_shared_memory ( ) {
455
459
Some ( m) => m. atomic_wait32 ( addr, expected, timeout) ,
456
460
None => {
@@ -461,12 +465,13 @@ impl Memory {
461
465
}
462
466
463
467
/// Implementation of `memory.atomic.wait64` for all memories.
468
+ #[ cfg( feature = "threads" ) ]
464
469
pub fn atomic_wait64 (
465
470
& mut self ,
466
471
addr : u64 ,
467
472
expected : u64 ,
468
- timeout : Option < Duration > ,
469
- ) -> Result < WaitResult , Trap > {
473
+ timeout : Option < core :: time :: Duration > ,
474
+ ) -> Result < crate :: WaitResult , Trap > {
470
475
match self . as_shared_memory ( ) {
471
476
Some ( m) => m. atomic_wait64 ( addr, expected, timeout) ,
472
477
None => {
@@ -736,6 +741,7 @@ impl LocalMemory {
736
741
/// we are using static memories with virtual memory guard pages) this manual
737
742
/// check is here so we don't segfault from Rust. For other configurations,
738
743
/// these checks are required anyways.
744
+ #[ cfg( feature = "threads" ) ]
739
745
pub fn validate_atomic_addr (
740
746
def : & VMMemoryDefinition ,
741
747
addr : u64 ,
0 commit comments