commit
989d7a78bb
1 changed files with 1 additions and 0 deletions
|
|
@ -187,6 +187,7 @@ impl<T> Vec<T> {
|
|||
let size = capacity.checked_mul(mem::size_of::<T>())
|
||||
.expect("capacity overflow");
|
||||
let ptr = unsafe { allocate(size, mem::min_align_of::<T>()) };
|
||||
if ptr.is_null() { ::alloc::oom() }
|
||||
Vec { ptr: ptr as *mut T, len: 0, cap: capacity }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue