From 50beb21b6361be13b61415b8c7a1ed09f9e47bf7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 17 Oct 2019 19:14:15 -0500 Subject: [PATCH] Add a missing api to the wasm C API (#433) This was used when [prototyping] but I found it wasn't implemented yet! [prototyping]: https://github.com/dtolnay/watt/issues/2#issuecomment-543007365 --- wasmtime-api/src/wasm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wasmtime-api/src/wasm.rs b/wasmtime-api/src/wasm.rs index 356466f0ac..71aee96bda 100644 --- a/wasmtime-api/src/wasm.rs +++ b/wasmtime-api/src/wasm.rs @@ -858,6 +858,11 @@ pub unsafe extern "C" fn wasm_valtype_new(kind: wasm_valkind_t) -> *mut wasm_val Box::into_raw(ty) } +#[no_mangle] +pub unsafe extern "C" fn wasm_valtype_delete(vt: *mut wasm_valtype_t) { + drop(Box::from_raw(vt)); +} + #[no_mangle] pub unsafe extern "C" fn wasm_byte_vec_new( out: *mut wasm_byte_vec_t,