Skip to content

Commit 984d8c1

Browse files
committed
Review comments
Signed-off-by: Alex Crichton <[email protected]>
1 parent a06b6b3 commit 984d8c1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

crates/core/src/lib.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ fn use_pooling_allocator_by_default() -> bool {
175175
match std::env::var("SPIN_WASMTIME_POOLING") {
176176
Ok(s) if s == "1" => return true,
177177
Ok(s) if s == "0" => return false,
178-
_ => {}
178+
Ok(s) => panic!("SPIN_WASMTIME_POOLING={s} not supported, only 1/0 supported"),
179+
Err(_) => {}
179180
}
180181

181182
// If the env var isn't set then perform the dynamic runtime probe
@@ -186,12 +187,18 @@ fn use_pooling_allocator_by_default() -> bool {
186187
match wasmtime::Engine::new(&config) {
187188
Ok(engine) => {
188189
let mut store = wasmtime::Store::new(&engine, ());
189-
// NB: the maximum size is in wasm pages to take out the 16-bits of
190-
// wasm page size here from the maximum size.
190+
// NB: the maximum size is in wasm pages so take out the 16-bits
191+
// of wasm page size here from the maximum size.
191192
let ty = wasmtime::MemoryType::new64(0, Some(1 << (BITS_TO_TEST - 16)));
192193
wasmtime::Memory::new(&mut store, ty).is_ok()
193194
}
194-
Err(_) => false,
195+
Err(_) => {
196+
tracing::debug!(
197+
"unable to create an engine to test the pooling \
198+
allocator, disabling pooling allocation"
199+
);
200+
false
201+
}
195202
}
196203
})
197204
}

0 commit comments

Comments
 (0)