Home
last modified time | relevance | path

Searched refs:new_size (Results 1 – 2 of 2) sorted by relevance

/rust/alloc/
Dalloc.rs38 fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8; in __rust_realloc()
127 pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { in realloc()
128 unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) } in realloc()
200 let new_size = new_layout.size(); in grow_impl() localVariable
203 intrinsics::assume(new_size >= old_layout.size()); in grow_impl()
205 let raw_ptr = realloc(ptr.as_ptr(), old_layout, new_size); in grow_impl()
208 raw_ptr.add(old_size).write_bytes(0, new_size - old_size); in grow_impl()
210 Ok(NonNull::slice_from_raw_parts(ptr, new_size)) in grow_impl()
292 new_size if old_layout.align() == new_layout.align() => unsafe { in shrink()
294 intrinsics::assume(new_size <= old_layout.size()); in shrink()
[all …]
/rust/kernel/
Dallocator.rs85 fn __rust_realloc(ptr: *mut u8, _old_size: usize, align: usize, new_size: usize) -> *mut u8 { in __rust_realloc()
87 let new_layout = unsafe { Layout::from_size_align_unchecked(new_size, align) }; in __rust_realloc()