MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / drop

Method drop

crates/core/src/error/error.rs:120–131  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

118
119impl Drop for BoxedDynError {
120 fn drop(&mut self) {
121 let ptr = self.inner.raw_copy();
122 // Safety: We own the pointer and it is valid for reading/writing
123 // `DynError`s.
124 let inner = unsafe { ptr.as_ref() };
125 let vtable = inner.vtable;
126 // Safety: The vtable is for this pointer's concrete type and the
127 // pointer is valid to deallocate because we are passing ownership in.
128 unsafe {
129 (vtable.drop_and_deallocate)(ptr);
130 }
131 }
132}
133
134impl BoxedDynError {

Callers

nothing calls this directly

Calls 4

raw_copyMethod · 0.80
is_boxed_dyn_errorMethod · 0.80
newFunction · 0.50
as_refMethod · 0.45

Tested by

no test coverage detected