forked from M-Labs/artiq
firmware: unbreak heap view.
This was missing since 7799413a
for no good reason.
This commit is contained in:
parent
db8300c990
commit
45c6ca96f8
|
@ -21,6 +21,7 @@ dependencies = [
|
|||
name = "board"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"build_artiq 0.0.0",
|
||||
"log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
|
@ -104,19 +104,17 @@ unsafe impl<'a> Alloc for &'a ListAlloc {
|
|||
}
|
||||
|
||||
fn oom(&mut self, err: AllocErr) -> ! {
|
||||
panic!("cannot allocate: {:?}", err)
|
||||
panic!("heap view: {}\ncannot allocate: {:?}", self, err)
|
||||
}
|
||||
}
|
||||
|
||||
impl ListAlloc {
|
||||
pub fn debug_dump(&self, f: &mut fmt::Write) -> fmt::Result {
|
||||
impl fmt::Display for ListAlloc {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
unsafe {
|
||||
let mut total_busy = 0;
|
||||
let mut total_idle = 0;
|
||||
let mut total_meta = 0;
|
||||
|
||||
write!(f, "Heap view:\n")?;
|
||||
|
||||
let mut curr = self.root;
|
||||
while !curr.is_null() {
|
||||
total_meta += mem::size_of::<Header>();
|
||||
|
|
Loading…
Reference in New Issue