mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-03 01:16:14 +03:00
Use precomputed TyLayout from machine.layouts
And add comment documenting successful return value from `mach_timebase_info`.
This commit is contained in:
+3
-4
@@ -173,13 +173,12 @@ fn mach_timebase_info(&mut self, info_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx,
|
||||
// `mach_absolute_time`, we don't need to scale the absolute
|
||||
// time.
|
||||
let (numer, denom) = (1,1);
|
||||
let uint32_layout = this.layout_of(this.tcx.types.u32)?;
|
||||
let imms = [
|
||||
immty_from_int_checked(numer, uint32_layout)?,
|
||||
immty_from_int_checked(denom, uint32_layout)?
|
||||
immty_from_int_checked(numer, this.machine.layouts.u32)?,
|
||||
immty_from_int_checked(denom, this.machine.layouts.u32)?
|
||||
];
|
||||
|
||||
this.write_packed_immediates(info, &imms)?;
|
||||
Ok(0)
|
||||
Ok(0) // KERN_SUCCESS
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user