(&self)
| 47 | |
| 48 | impl Clone for wasm_val_t { |
| 49 | fn clone(&self) -> Self { |
| 50 | #[allow( |
| 51 | unused_mut, |
| 52 | reason = "needed for conditional mutation under cfg(feature = \"gc\")" |
| 53 | )] |
| 54 | let mut ret = wasm_val_t { |
| 55 | kind: self.kind, |
| 56 | of: self.of, |
| 57 | }; |
| 58 | |
| 59 | #[cfg(feature = "gc")] |
| 60 | unsafe { |
| 61 | match self.kind { |
| 62 | WASM_FUNCREF | WASM_EXTERNREF if !self.of.ref_.is_null() => { |
| 63 | ret.of.ref_ = Box::into_raw(Box::new((*self.of.ref_).clone())); |
| 64 | } |
| 65 | _ => {} |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | return ret; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | impl Default for wasm_val_t { |