Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn allocate_byte_array(len: usize) -> Vec<u8> {
- let mut v: Vec<u8> = Vec::with_capacity(len);
- unsafe {
- v.set_len(len);
- }
- v
- }
- fn main() {
- let v = allocate_byte_array(1024*1024*1024*100);
- print!("size {}", v.len());
- }
Add Comment
Please, Sign In to add comment