Split BPF loader to match the rest of the programs (#4636)

This commit is contained in:
Jack May
2019-06-12 08:49:59 -07:00
committed by GitHub
parent dd1c3514a8
commit 0dcdc37fec
19 changed files with 52 additions and 57 deletions

View File

@@ -1,17 +0,0 @@
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<*mut u8, AllocErr>;
fn dealloc(&mut self, ptr: *mut u8, 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")
}
}