From 242e9a4ca861144764ba909dcf60ac64f8c2af01 Mon Sep 17 00:00:00 2001 From: ccgauche Date: Mon, 14 Dec 2020 21:48:37 +0100 Subject: [PATCH] Updated to zesterer suggestion --- plugin/rt/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/rt/src/lib.rs b/plugin/rt/src/lib.rs index f010266708..bf7d4cdd09 100644 --- a/plugin/rt/src/lib.rs +++ b/plugin/rt/src/lib.rs @@ -44,6 +44,6 @@ static mut BUFFERS: Vec = Vec::new(); /// This function should never be used only intented to by used by the host #[no_mangle] pub unsafe fn wasm_prepare_buffer(size: i32) -> i32 { - BUFFERS = Vec::::with_capacity(size as usize); + BUFFERS = vec![0u8; size as usize]; BUFFERS.as_ptr() as i32 }