Skip to content

Commit f9470dc

Browse files
committed
make StorePtr wrap a NonNull
1 parent fff3c0a commit f9470dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/wasmtime/src/runtime/vm/instance/allocator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub struct InstanceAllocationRequest<'a> {
9292
/// InstanceAllocationRequest, rather than on a &mut InstanceAllocationRequest
9393
/// itself, because several use-sites require a split mut borrow on the
9494
/// InstanceAllocationRequest.
95-
pub struct StorePtr(Option<crate::vm::SendSyncPtr<dyn VMStore>>);
95+
pub struct StorePtr(Option<NonNull<dyn VMStore>>);
9696

9797
// We can't make `VMStore: Send + Sync` because that requires making all of
9898
// Wastime's internals generic over the `Store`'s `T`. So instead, we take care
@@ -109,12 +109,12 @@ impl StorePtr {
109109

110110
/// A pointer to a Store.
111111
pub fn new(ptr: NonNull<dyn VMStore>) -> Self {
112-
Self(Some(ptr.into()))
112+
Self(Some(ptr))
113113
}
114114

115115
/// The raw contents of this struct
116116
pub fn as_raw(&self) -> Option<NonNull<dyn VMStore>> {
117-
self.0.map(|p| p.as_non_null())
117+
self.0
118118
}
119119

120120
/// Use the StorePtr as a mut ref to the Store.

0 commit comments

Comments
 (0)