about summary refs log tree commit diff
path: root/src/liballoc/btree/node.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2018-04-03 21:15:06 +0200
committerSimon Sapin <simon.sapin@exyr.org>2018-04-12 22:52:47 +0200
commite521b8b472dfe058f6d0f62f2e1ab5f291c220ee (patch)
treeb7bd74b0b572fc7143fd783a6e912b4d1ebbf1cc /src/liballoc/btree/node.rs
parent88ebd2d752831860d8824849cf6f5ae656a2c3eb (diff)
downloadrust-e521b8b472dfe058f6d0f62f2e1ab5f291c220ee.tar.gz
rust-e521b8b472dfe058f6d0f62f2e1ab5f291c220ee.zip
Actually deprecate the Heap type
Diffstat (limited to 'src/liballoc/btree/node.rs')
-rw-r--r--src/liballoc/btree/node.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/liballoc/btree/node.rs b/src/liballoc/btree/node.rs
index 49109d522e9..8e23228bd28 100644
--- a/src/liballoc/btree/node.rs
+++ b/src/liballoc/btree/node.rs
@@ -41,14 +41,13 @@
 // - A node of length `n` has `n` keys, `n` values, and (in an internal node) `n + 1` edges.
 //   This implies that even an empty internal node has at least one edge.
 
-use core::heap::{Alloc, Layout};
 use core::marker::PhantomData;
 use core::mem;
 use core::ptr::{self, Unique, NonNull};
 use core::slice;
 
+use alloc::{Global, Alloc, Layout};
 use boxed::Box;
-use heap::Heap;
 
 const B: usize = 6;
 pub const MIN_LEN: usize = B - 1;
@@ -250,7 +249,7 @@ impl<K, V> Root<K, V> {
         self.as_mut().as_leaf_mut().parent = ptr::null();
 
         unsafe {
-            Heap.dealloc(top, Layout::new::<InternalNode<K, V>>());
+            Global.dealloc(top, Layout::new::<InternalNode<K, V>>());
         }
     }
 }
@@ -436,7 +435,7 @@ impl<K, V> NodeRef<marker::Owned, K, V, marker::Leaf> {
     > {
         let ptr = self.as_leaf() as *const LeafNode<K, V> as *const u8 as *mut u8;
         let ret = self.ascend().ok();
-        Heap.dealloc(ptr, Layout::new::<LeafNode<K, V>>());
+        Global.dealloc(ptr, Layout::new::<LeafNode<K, V>>());
         ret
     }
 }
@@ -457,7 +456,7 @@ impl<K, V> NodeRef<marker::Owned, K, V, marker::Internal> {
     > {
         let ptr = self.as_internal() as *const InternalNode<K, V> as *const u8 as *mut u8;
         let ret = self.ascend().ok();
-        Heap.dealloc(ptr, Layout::new::<InternalNode<K, V>>());
+        Global.dealloc(ptr, Layout::new::<InternalNode<K, V>>());
         ret
     }
 }
@@ -1239,12 +1238,12 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
                     ).correct_parent_link();
                 }
 
-                Heap.dealloc(
+                Global.dealloc(
                     right_node.node.as_ptr() as *mut u8,
                     Layout::new::<InternalNode<K, V>>(),
                 );
             } else {
-                Heap.dealloc(
+                Global.dealloc(
                     right_node.node.as_ptr() as *mut u8,
                     Layout::new::<LeafNode<K, V>>(),
                 );