mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Inline and remove DroplessArena::grow_and_alloc
.
It has a single callsite.
This commit is contained in:
parent
a11f7e4c0f
commit
0001eddb93
@ -463,12 +463,6 @@ impl DroplessArena {
|
|||||||
self.alloc_raw_without_grow(layout).unwrap()
|
self.alloc_raw_without_grow(layout).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(never)]
|
|
||||||
#[cold]
|
|
||||||
fn grow_and_alloc<T>(&self) -> *mut u8 {
|
|
||||||
self.grow_and_alloc_raw(Layout::new::<T>())
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Allocates a byte slice with specified layout from the current memory
|
/// Allocates a byte slice with specified layout from the current memory
|
||||||
/// chunk. Returns `None` if there is no free space left to satisfy the
|
/// chunk. Returns `None` if there is no free space left to satisfy the
|
||||||
/// request.
|
/// request.
|
||||||
@ -517,7 +511,7 @@ impl DroplessArena {
|
|||||||
} else {
|
} else {
|
||||||
// No free space left. Allocate a new chunk to satisfy the request.
|
// No free space left. Allocate a new chunk to satisfy the request.
|
||||||
// On failure the grow will panic or abort.
|
// On failure the grow will panic or abort.
|
||||||
self.grow_and_alloc::<T>()
|
self.grow_and_alloc_raw(Layout::new::<T>())
|
||||||
} as *mut T;
|
} as *mut T;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Loading…
Reference in New Issue
Block a user