ソースを参照

Fix PartialEq

ticki 9 年 前
コミット
c4f7593838
2 ファイル変更5 行追加5 行削除
  1. 2 2
      src/block.rs
  2. 3 3
      src/bookkeeper.rs

+ 2 - 2
src/block.rs

@@ -38,8 +38,8 @@ impl Ord for Block {
 }
 
 impl cmp::PartialEq for Block {
-    fn eq(&self, _: &Block) -> bool {
-        false
+    fn eq(&self, other: &Block) -> bool {
+        self.size == other.size && *self.ptr == *other.ptr
     }
 }
 

+ 3 - 3
src/bookkeeper.rs

@@ -104,8 +104,8 @@ fn canonicalize_brk(size: usize) -> usize {
 ///
 /// This primitive is used for keeping track of the free blocks.
 ///
-/// Guarantees made.
-/// ================
+/// Guarantees
+/// ==========
 ///
 /// Certain guarantees are made:
 ///
@@ -116,7 +116,7 @@ fn canonicalize_brk(size: usize) -> usize {
 /// Merging
 /// =======
 ///
-/// Merging is the way the block lists keep these guarentees. Merging works by adding two adjacent
+/// Merging is the way the block lists keep these guarantees. Merging works by adding two adjacent
 /// free blocks to one, and then marking the secondary block as occupied.
 struct BlockList {
     /// The capacity of the block list.