Lines Matching refs:layout

184             let layout = match Layout::array::<T>(capacity) {  in allocate_in()  localVariable
185 Ok(layout) => layout, in allocate_in()
188 match alloc_guard(layout.size()) { in allocate_in()
193 AllocInit::Uninitialized => alloc.allocate(layout), in allocate_in()
194 AllocInit::Zeroed => alloc.allocate_zeroed(layout), in allocate_in()
198 Err(_) => handle_alloc_error(layout), in allocate_in()
218 let layout = Layout::array::<T>(capacity).map_err(|_| CapacityOverflow)?; in try_allocate_in() localVariable
219 alloc_guard(layout.size())?; in try_allocate_in()
221 AllocInit::Uninitialized => alloc.allocate(layout), in try_allocate_in()
222 AllocInit::Zeroed => alloc.allocate_zeroed(layout), in try_allocate_in()
224 let ptr = result.map_err(|_| AllocError { layout, non_exhaustive: () })?; in try_allocate_in()
284 let layout = Layout::from_size_align_unchecked(size, align); in current_memory() localVariable
285 Some((self.ptr.cast().into(), layout)) in current_memory()
471 let (ptr, layout) = if let Some(mem) = self.current_memory() { mem } else { return Ok(()) }; in shrink()
479 unsafe { self.alloc.deallocate(ptr, layout) }; in shrink()
487 let new_layout = Layout::from_size_align_unchecked(new_size, layout.align()); in shrink()
489 .shrink(ptr, layout, new_layout) in shrink()
490 .map_err(|_| AllocError { layout: new_layout, non_exhaustive: () })? in shrink()
527 memory.map_err(|_| AllocError { layout: new_layout, non_exhaustive: () }.into()) in finish_grow()
533 if let Some((ptr, layout)) = self.current_memory() { in drop()
534 unsafe { self.alloc.deallocate(ptr, layout) } in drop()
545 Err(AllocError { layout, .. }) => handle_alloc_error(layout), in handle_reserve()