Lines Matching +full:non +full:- +full:zero
1 // SPDX-License-Identifier: GPL-2.0
16 /// - `ptr` can be either null or a pointer which has been allocated by this allocator.
17 /// - `new_layout` must have a non-zero size.
18 unsafe fn krealloc_aligned(ptr: *mut u8, new_layout: Layout, flags: bindings::gfp_t) -> *mut u8 { in krealloc_aligned()
26 // to use the "power-of-two" size/alignment guarantee (see comments in `kmalloc()` for in krealloc_aligned()
35 // - `ptr` is either null or a pointer returned from a previous `k{re}alloc()` by the in krealloc_aligned()
37 // - `size` is greater than 0 since it's either a `layout.size()` (which cannot be zero in krealloc_aligned()
43 unsafe fn alloc(&self, layout: Layout) -> *mut u8 { in alloc()
44 // SAFETY: `ptr::null_mut()` is null and `layout` has a non-zero size by the function safety in alloc()
55 unsafe fn realloc(&self, ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { in realloc()
57 // - `new_size`, when rounded up to the nearest multiple of `layout.align()`, will not in realloc()
59 // - `layout.align()` is a proper alignment (i.e. not zero and must be a power of two). in realloc()
63 // - `ptr` is either null or a pointer allocated by this allocator by the function safety in realloc()
65 // - the size of `layout` is not zero because `new_size` is not zero by the function safety in realloc()
70 unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 { in alloc_zeroed()
71 // SAFETY: `ptr::null_mut()` is null and `layout` has a non-zero size by the function safety in alloc_zeroed()
86 // See <https://github.com/rust-lang/rust/pull/86844>.