tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 1311HTML 640Markdown 11TOML 63653 Sutichaykuna

Remove Allocator::free (#105)

9176e9bd7412adb1b1d9dda1eed5a877817a7d95 · ruwaq Alice Cecile · (4 wata ñawpaq) · tayta 8e917781e · kay commitpi sach'ata qhaway

Semántico sayk'uy · 3

src/node.rs

  • ukhunpi t'ikrakurqan fn clear pub
  • qullusqa fn drop
  • qullusqa fn free pub

1 qillqakuna · +0 −13

diff --git a/src/node.rs b/src/node.rs
index 666b08edd..9a8e95b25 100644
--- a/src/node.rs
+++ b/src/node.rs
@@ -1,5 +1,3 @@
-use core::ops::Drop;
-
 use crate::forest::Forest;
 use crate::geometry::Size;
 use crate::layout::Layout;
@@ -94,9 +92,6 @@ impl Sprawl {
     ///
     /// All associated nodes will be invalid.
     pub fn clear(&mut self) {
-        for node in self.nodes_to_ids.keys() {
-            self.nodes.free(&[node.local]);
-        }
         self.nodes_to_ids.clear();
         self.ids_to_nodes.clear();
         self.forest.clear();
@@ -231,12 +226,6 @@ impl Sprawl {
     }
 }
 
-impl Drop for Sprawl {
-    fn drop(&mut self) {
-        INSTANCE_ALLOCATOR.free(&[self.id]);
-    }
-}
-
 /// Internal node id.
 pub(crate) type NodeId = usize;
 
@@ -256,6 +245,4 @@ impl Allocator {
     pub fn allocate(&self) -> Id {
         Id(self.new_id.fetch_add(1, Ordering::Relaxed))
     }
-
-    pub fn free(&self, _ids: &[Id]) {}
 }