We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DroplessArena::alloc
DroplessArena::alloc_raw
1 parent 98d97b7 commit 25407bcCopy full SHA for 25407bc
compiler/rustc_arena/src/lib.rs
@@ -501,14 +501,7 @@ impl DroplessArena {
501
assert!(!mem::needs_drop::<T>());
502
assert!(mem::size_of::<T>() != 0);
503
504
- let layout = Layout::new::<T>();
505
- let mem = if let Some(a) = self.alloc_raw_without_grow(layout) {
506
- a
507
- } else {
508
- // No free space left. Allocate a new chunk to satisfy the request.
509
- // On failure the grow will panic or abort.
510
- self.grow_and_alloc_raw(layout)
511
- } as *mut T;
+ let mem = self.alloc_raw(Layout::new::<T>()) as *mut T;
512
513
unsafe {
514
// Write into uninitialized memory.
0 commit comments