Last active
May 18, 2018 08:49
-
-
Save andrei-cacio/d14af0c2275e5c8788d69d345484cdca to your computer and use it in GitHub Desktop.
Rust vector to JS example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[no_mangle] | |
pub fn simple_arr() -> *mut i32 { | |
let vec = Box::new([100, 200, 300, 400]); | |
Box::into_raw(vec) as *mut i32 | |
} | |
fn main() { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment