Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

Commit

Permalink
Update nightly
Browse files Browse the repository at this point in the history
Updated to `nightly-x86_64-apple-darwin updated - rustc 1.41.0-nightly
(19bd93467 2019-12-18)`.  It includes
rust-lang/rust#66256, which removed the `unwrap`
on `align_to_pad`.
  • Loading branch information
KronicDeth committed Dec 19, 2019
1 parent 88469d6 commit 789a6b9
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions liblumen_alloc/src/blocks/free_block_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl FreeBlocks {
let mut cursor = self.addr_tree.front();
let mut result = None;

let aligned = layout.pad_to_align().unwrap();
let aligned = layout.pad_to_align();
let requested = aligned.size();

while let Some(block) = cursor.get() {
Expand All @@ -77,7 +77,7 @@ impl FreeBlocks {
let mut result = None;
let mut best_size = 0;

let aligned = layout.pad_to_align().unwrap();
let aligned = layout.pad_to_align();
let requested = aligned.size();

match self.order {
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl HeapAlloc for HeapFragment {
use liblumen_core::sys::sysconf::MIN_ALIGN;

// Ensure layout has alignment padding
let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align().unwrap();
let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align();
// Capture the base pointer for this allocation
let top = self.heap_top() as *mut u8;
// Calculate available space and fail if not enough is free
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/process/gc/old_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl HeapAlloc for OldHeap {
unsafe fn alloc_layout(&mut self, layout: Layout) -> AllocResult<NonNull<Term>> {
use liblumen_core::sys::sysconf::MIN_ALIGN;

let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align().unwrap();
let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align();

let needed = layout.size();
let available = self.heap_available() * mem::size_of::<Term>();
Expand Down
3 changes: 1 addition & 2 deletions liblumen_alloc/src/erts/process/gc/sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ where

let layout = Layout::from_size_align(words * mem::size_of::<Term>(), MIN_ALIGN)
.unwrap()
.pad_to_align()
.unwrap();
.pad_to_align();
let total_size = layout.size();

// Allocate space for move
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/process/gc/young_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ impl HeapAlloc for YoungHeap {
unsafe fn alloc_layout(&mut self, layout: Layout) -> AllocResult<NonNull<Term>> {
use liblumen_core::sys::sysconf::MIN_ALIGN;

let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align().unwrap();
let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align();

let needed = layout.size();
let available = self.heap_available() * mem::size_of::<Term>();
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/term/binary/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl HeapBin {
// We pad to alignment so that the Layout produced here
// matches that returned by `Layout::for_value` on the
// final `HeapBin`
let layout = unpadded_layout.pad_to_align().unwrap();
let layout = unpadded_layout.pad_to_align();

(layout, flags_offset, data_offset)
}
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/term/binary/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl ProcBin {
// We pad to alignment so that the Layout produced here
// matches that returned by `Layout::for_value` on the
// final `ProcBinInner`
let layout = unpadded_layout.pad_to_align().unwrap();
let layout = unpadded_layout.pad_to_align();

unsafe {
let non_null = sys_alloc::alloc(layout)?;
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/term/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl ClosureLayout {
let (layout, code_offset) = layout.extend(Layout::new::<Option<Code>>()).unwrap();
let (layout, env_offset) = layout.extend(Layout::for_value(env)).unwrap();

let layout = layout.pad_to_align().unwrap();
let layout = layout.pad_to_align();

Self {
layout,
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/term/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Tuple {
// We pad to alignment so that the Layout produced here
// matches that returned by `Layout::for_value` on the
// final `Tuple`
let layout = base_layout.pad_to_align().unwrap();
let layout = base_layout.pad_to_align();

(layout, data_offset)
}
Expand Down
2 changes: 1 addition & 1 deletion liblumen_alloc/src/erts/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl HeapAlloc for RegionHeap {
/// process heap during garbage collection
unsafe fn alloc_layout(&mut self, layout: Layout) -> AllocResult<NonNull<Term>> {
// Ensure layout has alignment padding
let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align().unwrap();
let layout = layout.align_to(MIN_ALIGN).unwrap().pad_to_align();
// Capture the base pointer for this allocation
let top = self.top;
// Calculate available space and fail if not enough is free
Expand Down
2 changes: 1 addition & 1 deletion liblumen_eir_interpreter/src/exec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ impl CallExecutor {

let mut exec = self;
// Outer loop for optimized execution within the current function
'outer: loop {
loop {
// Insert block argument into environment
let block_arg_vals = fun.fun.block_args(block);
//trace!("{:?} {:?}", &block_arg_vals, &exec.next_args);
Expand Down

0 comments on commit 789a6b9

Please sign in to comment.