Updated to zesterer suggestion

This commit is contained in:
ccgauche 2020-12-14 21:48:37 +01:00
parent ea1efd1ce1
commit 7f20c78ce6

View File

@ -44,6 +44,6 @@ static mut BUFFERS: Vec<u8> = 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::<u8>::with_capacity(size as usize);
BUFFERS = vec![0u8; size as usize];
BUFFERS.as_ptr() as i32
}