Merge branch 'post-11' into post-12

This commit is contained in:
Philipp Oppermann
2020-06-05 15:52:04 +02:00

View File

@@ -45,7 +45,7 @@ impl LinkedListAllocator {
/// Adds the given memory region to the front of the list. /// Adds the given memory region to the front of the list.
unsafe fn add_free_region(&mut self, addr: usize, size: usize) { unsafe fn add_free_region(&mut self, addr: usize, size: usize) {
// ensure that the freed region is capable of holding ListNode // ensure that the freed region is capable of holding ListNode
assert!(align_up(addr, mem::align_of::<ListNode>()) == addr); assert_eq!(align_up(addr, mem::align_of::<ListNode>()), addr);
assert!(size >= mem::size_of::<ListNode>()); assert!(size >= mem::size_of::<ListNode>());
// create a new list node and append it at the start of the list // create a new list node and append it at the start of the list