Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit e3a5b24

Browse files
committed
rustfmt
1 parent 71152a1 commit e3a5b24

3 files changed

Lines changed: 36 additions & 8 deletions

File tree

benchmarks/lucet-benchmarks/src/context.rs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ fn context_init(c: &mut Criterion) {
99

1010
c.bench_function("context_init", move |b| {
1111
b.iter(|| {
12-
ContextHandle::create_and_init(&mut *stack, f as usize, &[], std::ptr::null_mut()).unwrap();
12+
ContextHandle::create_and_init(&mut *stack, f as usize, &[], std::ptr::null_mut())
13+
.unwrap();
1314
})
1415
});
1516
}
@@ -22,7 +23,13 @@ fn context_swap_return(c: &mut Criterion) {
2223
b.iter_batched(
2324
|| {
2425
let mut stack = vec![0u64; 1024].into_boxed_slice();
25-
let child = ContextHandle::create_and_init(&mut *stack, f as usize, &[], std::ptr::null_mut()).unwrap();
26+
let child = ContextHandle::create_and_init(
27+
&mut *stack,
28+
f as usize,
29+
&[],
30+
std::ptr::null_mut(),
31+
)
32+
.unwrap();
2633
(stack, child)
2734
},
2835
|(stack, mut child)| unsafe {
@@ -44,8 +51,13 @@ fn context_init_swap_return(c: &mut Criterion) {
4451
|| vec![0u64; 1024].into_boxed_slice(),
4552
|mut stack| {
4653
let mut parent = ContextHandle::new();
47-
let mut child =
48-
ContextHandle::create_and_init(&mut *stack, f as usize, &[], std::ptr::null_mut()).unwrap();
54+
let mut child = ContextHandle::create_and_init(
55+
&mut *stack,
56+
f as usize,
57+
&[],
58+
std::ptr::null_mut(),
59+
)
60+
.unwrap();
4961
unsafe { Context::swap(&mut parent, &mut child) };
5062
stack
5163
},
@@ -332,8 +344,13 @@ fn context_init_swap_return_many_args(c: &mut Criterion) {
332344
|| vec![0u64; 1024].into_boxed_slice(),
333345
|mut stack| {
334346
let mut parent = ContextHandle::new();
335-
let mut child =
336-
ContextHandle::create_and_init(&mut *stack, f as usize, &args, std::ptr::null_mut()).unwrap();
347+
let mut child = ContextHandle::create_and_init(
348+
&mut *stack,
349+
f as usize,
350+
&args,
351+
std::ptr::null_mut(),
352+
)
353+
.unwrap();
337354
unsafe { Context::swap(&mut parent, &mut child) };
338355
stack
339356
},

lucet-runtime/lucet-runtime-internals/src/context/tests/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ fn init_rejects_unaligned() {
3131
let mut stack_unaligned = unsafe { slice::from_raw_parts_mut(ptr, len) };
3232

3333
// now we have the unaligned stack, let's make sure it blows up right
34-
let res = ContextHandle::create_and_init(&mut stack_unaligned, dummy as usize, &[], std::ptr::null_mut());
34+
let res = ContextHandle::create_and_init(
35+
&mut stack_unaligned,
36+
dummy as usize,
37+
&[],
38+
std::ptr::null_mut(),
39+
);
3540

3641
if let Err(Error::UnalignedStack) = res {
3742
assert!(true);

lucetc/src/compiler.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ impl<'a> Compiler<'a> {
7272
canonicalize_nans: bool,
7373
pinned_heap: bool,
7474
) -> Result<Self, Error> {
75-
let isa = Self::target_isa(target.clone(), opt_level, &cpu_features, canonicalize_nans, pinned_heap)?;
75+
let isa = Self::target_isa(
76+
target.clone(),
77+
opt_level,
78+
&cpu_features,
79+
canonicalize_nans,
80+
pinned_heap,
81+
)?;
7682

7783
let frontend_config = isa.frontend_config();
7884
let mut module_info = ModuleInfo::new(frontend_config.clone());

0 commit comments

Comments
 (0)