From 6ca24828bc0adee8868279b5ddc0fdd1038df263 Mon Sep 17 00:00:00 2001 From: ccgauche Date: Mon, 14 Dec 2020 17:43:32 +0100 Subject: [PATCH] added unsafe on function --- plugin/rt/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugin/rt/src/lib.rs b/plugin/rt/src/lib.rs index a8dd8c9b2b..ef7c25d0cd 100644 --- a/plugin/rt/src/lib.rs +++ b/plugin/rt/src/lib.rs @@ -41,9 +41,7 @@ static mut BUFFERS: Vec = Vec::new(); /// Allocate buffer from wasm linear memory #[no_mangle] -pub fn wasm_prepare_buffer(size: i32) -> i32 { - unsafe { - BUFFERS = Vec::::with_capacity(size as usize); - BUFFERS.as_ptr() as i32 - } +pub unsafe fn wasm_prepare_buffer(size: i32) -> i32 { + BUFFERS = Vec::::with_capacity(size as usize); + BUFFERS.as_ptr() as i32 }