Skip to content

Commit

Permalink
Merge #923
Browse files Browse the repository at this point in the history
923: Add probable fix of memory leak in trampoline code r=MarkMcCaskey a=MarkMcCaskey

might be what's needed for #810 ; but despite my best efforts I could not get asan working on osx, so I did not test it.

By my count this accounts for 40 bytes, so there may be another issue

edit: unless Rust is optimizing out turning a zero-sized type into a Box, in which case, this should account for 48 bytes

Co-authored-by: Mark McCaskey <[email protected]>
  • Loading branch information
bors[bot] and Mark McCaskey authored Nov 11, 2019
2 parents 8233f4c + 8d95e63 commit 25ebbaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/runtime-c-api/src/trampoline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub unsafe extern "C" fn wasmer_trampoline_buffer_builder_build(
#[allow(clippy::cast_ptr_alignment)]
pub unsafe extern "C" fn wasmer_trampoline_buffer_destroy(buffer: *mut wasmer_trampoline_buffer_t) {
if !buffer.is_null() {
Box::from_raw(buffer);
Box::from_raw(buffer as *mut TrampolineBuffer);
}
}

Expand Down

0 comments on commit 25ebbaa

Please sign in to comment.