Bug 821151 - Never call destructors for splay tree elements, r=luke.
authorBrian Hackett <bhackett1024@gmail.com>
Fri, 14 Dec 2012 11:47:27 -0700
changeset 116099 aafa9e2de5325478e00064bfe4908eb5bbd65352
parent 116098 6fb67e58bad6f0f7d04be11729ad1d52e1ad48ae
child 116100 dc4887f61d2e2042b1af209927d23686fd68302c
push id24043
push userryanvm@gmail.com
push dateSat, 15 Dec 2012 21:18:16 +0000
treeherdermozilla-central@c8a1314aa449 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs821151
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 821151 - Never call destructors for splay tree elements, r=luke.
js/src/ds/SplayTree.h
--- a/js/src/ds/SplayTree.h
+++ b/js/src/ds/SplayTree.h
@@ -13,17 +13,18 @@
 namespace js {
 
 /*
  * Class which represents a splay tree with nodes allocated from a LifoAlloc.
  * Splay trees are balanced binary search trees for which search, insert and
  * remove are all amortized O(log n).
  *
  * T indicates the type of tree elements, C must have a static
- * compare(const T&, const T&) method ordering the elements.
+ * compare(const T&, const T&) method ordering the elements. As for LifoAlloc
+ * objects, T objects stored in the tree will not be explicitly destroyed.
  */
 template <class T, class C>
 class SplayTree
 {
     struct Node {
         T item;
         Node *left, *right, *parent;
 
@@ -162,17 +163,16 @@ class SplayTree
             new(node) Node(v);
             return node;
         }
         return alloc->new_<Node>(v);
     }
 
     void freeNode(Node *node)
     {
-        node->item.~T();
         node->left = freeList;
         freeList = node;
     }
 
     void splay(Node *node)
     {
         // Rotate the element until it is at the root of the tree. Performing
         // the rotations in this fashion preserves the amortized balancing of