Guest User

Untitled

a guest
Jun 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. fn allocate_byte_array(len: usize) -> Vec<u8> {
  2. let mut v: Vec<u8> = Vec::with_capacity(len);
  3. unsafe {
  4. v.set_len(len);
  5. }
  6. v
  7. }
  8.  
  9. fn main() {
  10. let v = allocate_byte_array(1024*1024*1024*100);
  11. print!("size {}", v.len());
  12. }
Add Comment
Please, Sign In to add comment