Nightly opts

This commit is contained in:
Erin 2023-07-26 20:54:24 +02:00 committed by ondra05
parent 64ae39295d
commit 7e1257a84d
4 changed files with 6 additions and 0 deletions

View file

@ -9,6 +9,7 @@ lto = true
[features] [features]
default = ["alloc"] default = ["alloc"]
alloc = [] alloc = []
nightly = []
[dependencies] [dependencies]
delegate = "0.9" delegate = "0.9"

View file

@ -12,6 +12,8 @@
#![no_std] #![no_std]
#![cfg_attr(feature = "nightly", feature(fn_align))]
#[cfg(feature = "alloc")] #[cfg(feature = "alloc")]
extern crate alloc; extern crate alloc;
@ -90,6 +92,7 @@ impl<'a, PfHandler: HandlePageFault, const TIMER_QUOTIENT: usize>
/// Execute program /// Execute program
/// ///
/// Program can return [`VmRunError`] if a trap handling failed /// Program can return [`VmRunError`] if a trap handling failed
#[cfg_attr(feature = "nightly", repr(align(4096)))]
pub fn run(&mut self) -> Result<VmRunOk, VmRunError> { pub fn run(&mut self) -> Result<VmRunOk, VmRunError> {
use hbbytecode::opcode::*; use hbbytecode::opcode::*;
loop { loop {

View file

@ -26,6 +26,7 @@ pub struct BlockCopier {
} }
impl BlockCopier { impl BlockCopier {
#[inline]
pub fn new(src: u64, dst: u64, count: usize) -> Self { pub fn new(src: u64, dst: u64, count: usize) -> Self {
Self { Self {
src, src,

View file

@ -310,6 +310,7 @@ struct AddrPageLookuper {
impl AddrPageLookuper { impl AddrPageLookuper {
/// Create a new page lookuper /// Create a new page lookuper
#[inline]
pub const fn new(addr: u64, size: usize, pagetable: *const PageTable) -> Self { pub const fn new(addr: u64, size: usize, pagetable: *const PageTable) -> Self {
Self { Self {
addr, addr,