Function
wasmtime_config_cache_config_load
(
c: &mut wasm_config_t,
filename: *const c_char,
)
Source from the content-addressed store, hash-verified
| 248 | #[unsafe(no_mangle)] |
| 249 | #[cfg(feature = "cache")] |
| 250 | pub unsafe extern "C" fn wasmtime_config_cache_config_load( |
| 251 | c: &mut wasm_config_t, |
| 252 | filename: *const c_char, |
| 253 | ) -> Option<Box<wasmtime_error_t>> { |
| 254 | use std::path::Path; |
| 255 | |
| 256 | use wasmtime::Cache; |
| 257 | |
| 258 | handle_result( |
| 259 | if filename.is_null() { |
| 260 | Cache::from_file(None).map(|cache| c.config.cache(Some(cache))) |
| 261 | } else { |
| 262 | match CStr::from_ptr(filename).to_str() { |
| 263 | Ok(s) => { |
| 264 | Cache::from_file(Some(&Path::new(s))).map(|cache| c.config.cache(Some(cache))) |
| 265 | } |
| 266 | Err(e) => Err(e.into()), |
| 267 | } |
| 268 | }, |
| 269 | |_cfg| {}, |
| 270 | ) |
| 271 | } |
| 272 | |
| 273 | #[unsafe(no_mangle)] |
| 274 | pub extern "C" fn wasmtime_config_memory_may_move_set(c: &mut wasm_config_t, enable: bool) { |
Tested by
no test coverage detected