fn coalesce(&mut self) {
        let mut newlist = Vec::new();
        let mut curr = self.freelist[0];

        for node in self.freelist[1..].iter() {
            if node.addr == curr.addr + curr.size {
                curr = FreeNode::new(curr.addr, curr.size + node.size);
            } else {
                newlist.push(curr);
                curr = *node;
            }
        }

        newlist.push(curr);
        self.freelist = newlist;
    }
// For this to even work well, the freelist
// needs to be sorted by address
For this to even work well, the freelist
needs to be sorted by address
For this to even work well the freelist needs to be sorted by address
fn coalesce(&mut self) {
        let mut newlist = Vec::new();
        let mut curr = self.freelist[0];
        for node in self.freelist[1..].iter() {
            if node.addr == curr.addr + curr.size {
                curr = FreeNode::new(curr.addr, curr.size + node.size);
            } else {
                newlist.push(curr);
                curr = *node;
            }
        }
        newlist.push(curr);
        self.freelist = newlist;
    }
fn coalesce ( & mut self ) { let mut newlist = Vec :: new ( ) ; let mut curr = self . freelist [ 0 ] ; for node in self . freelist [ 1 .. ] . iter ( ) { if node . addr == curr . addr + curr . size { curr = FreeNode :: new ( curr . addr , curr . size + node . size ) ; } else { newlist . push ( curr ) ; curr = * node ; } } newlist . push ( curr ) ; self . freelist = newlist ; }
For this to even work well, the freelist
needs to be sorted by address
For this to even work well the freelist needs to be sorted by address
&mut self
&mut self