WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 66363
66203
WTF does not have a balanced tree implementation that would be suitable for use in a memory allocator
https://bugs.webkit.org/show_bug.cgi?id=66203
Summary
WTF does not have a balanced tree implementation that would be suitable for u...
Filip Pizlo
Reported
2011-08-13 20:09:03 PDT
WTF has an AVL tree implementation, but it does not allow for the removal of specific nodes - only the removal of keys. Hence, if the user wishes to remove a specific node, which may have a key equal to any number of other nodes in the tree, then the AVLTree code is not particularly useful. Furthermore, AVL trees are somewhat less efficient than red-black trees, so it would be preferable to have a red-black tree instead. WebCore has a red-black tree implementation (PODRedBlackTree), but it internally manages nodes and assumes that it is fine to copy one node into another. Hence, if a pointer to a node is also placed into other data structures, then PODRedBlackTree operations may lead to the pointers being invalidated. As well, PODRedBlackTree makes it impossible to place a node inside of the free space that it would represent, if a red-black tree was used for free space management. WTF should have a red-black tree implementation that allows the user to decide how nodes are allocated, ensures that pointers into nodes in the tree remain valid regardless of operations on other nodes in the tree, and allows for specific nodes to be removed instead of just removal by key.
Attachments
Add attachment
proposed patch, testcase, etc.
Gavin Barraclough
Comment 1
2011-08-13 22:24:35 PDT
We generally don't accept patches that only check in unused code. As such, if this bug intends to just check in the tree unused, I'm afraid it is likely to be r-'ed. :-(
Filip Pizlo
Comment 2
2011-08-13 22:26:46 PDT
(In reply to
comment #1
)
> We generally don't accept patches that only check in unused code. As such, if this bug intends to just check in the tree unused, I'm afraid it is likely to be r-'ed. :-(
Tests don't count?
Filip Pizlo
Comment 3
2011-08-16 23:40:43 PDT
Closing this since *** This bug has been marked as a duplicate of
bug 66363
***
Filip Pizlo
Comment 4
2011-08-16 23:41:45 PDT
(In reply to
comment #3
)
> Closing this since > > *** This bug has been marked as a duplicate of
bug 66363
***
Closing this since it is a work-in-progress prerequisite of
bug 66363
. It would be better to have a single patch in this case, rather than smaller patches that by themselves don't do anything.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug