Merge api/program into single units (#7061)

This commit is contained in:
Jack May
2019-11-20 16:32:19 -08:00
committed by GitHub
parent 186bf7ae32
commit 3415db9739
105 changed files with 224 additions and 4095 deletions

View File

@@ -0,0 +1,17 @@
use std::alloc::Layout;
use std::fmt;
/// Based loosely on the unstable std::alloc::Alloc trait
pub trait Alloc {
fn alloc(&mut self, layout: Layout) -> Result<u64, AllocErr>;
fn dealloc(&mut self, addr: u64, layout: Layout);
}
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct AllocErr;
impl fmt::Display for AllocErr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Error: Memory allocation failed")
}
}