File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,8 @@ fn use_pooling_allocator_by_default() -> bool {
175
175
match std:: env:: var ( "SPIN_WASMTIME_POOLING" ) {
176
176
Ok ( s) if s == "1" => return true ,
177
177
Ok ( s) if s == "0" => return false ,
178
- _ => { }
178
+ Ok ( s) => panic ! ( "SPIN_WASMTIME_POOLING={s} not supported, only 1/0 supported" ) ,
179
+ Err ( _) => { }
179
180
}
180
181
181
182
// If the env var isn't set then perform the dynamic runtime probe
@@ -186,12 +187,18 @@ fn use_pooling_allocator_by_default() -> bool {
186
187
match wasmtime:: Engine :: new ( & config) {
187
188
Ok ( engine) => {
188
189
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.
191
192
let ty = wasmtime:: MemoryType :: new64 ( 0 , Some ( 1 << ( BITS_TO_TEST - 16 ) ) ) ;
192
193
wasmtime:: Memory :: new ( & mut store, ty) . is_ok ( )
193
194
}
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
+ }
195
202
}
196
203
} )
197
204
}
You can’t perform that action at this time.
0 commit comments