diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-08-27 15:18:12 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2013-08-27 15:18:12 -0700 |
commit | 26bc8db33f15a365e22f23229d0700d70ac0d560 (patch) | |
tree | fbe2f60ef1380c023efa66e86d53d1d9f42ddb7c /deps/v8/src/splay-tree.h | |
parent | d86814aeca64d8985402dc073eff1fc8ac93c231 (diff) | |
download | node-new-26bc8db33f15a365e22f23229d0700d70ac0d560.tar.gz |
v8: upgrade to 3.20.17
Diffstat (limited to 'deps/v8/src/splay-tree.h')
-rw-r--r-- | deps/v8/src/splay-tree.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/deps/v8/src/splay-tree.h b/deps/v8/src/splay-tree.h index 8844d8a8ff..f393027a82 100644 --- a/deps/v8/src/splay-tree.h +++ b/deps/v8/src/splay-tree.h @@ -39,9 +39,9 @@ namespace internal { // // typedef Key: the key type // typedef Value: the value type -// static const kNoKey: the dummy key used when no key is set -// static const kNoValue: the dummy value used to initialize nodes -// int (Compare)(Key& a, Key& b) -> {-1, 0, 1}: comparison function +// static const Key kNoKey: the dummy key used when no key is set +// static Value kNoValue(): the dummy value used to initialize nodes +// static int (Compare)(Key& a, Key& b) -> {-1, 0, 1}: comparison function // // The tree is also parameterized by an allocation policy // (Allocator). The policy is used for allocating lists in the C free @@ -74,6 +74,11 @@ class SplayTree { UNREACHABLE(); } + AllocationPolicy allocator() { return allocator_; } + + // Checks if there is a mapping for the key. + bool Contains(const Key& key); + // Inserts the given key in this tree with the given value. Returns // true if a node was inserted, otherwise false. If found the locator // is enabled and provides access to the mapping for the key. @@ -104,6 +109,9 @@ class SplayTree { // Remove the node with the given key from the tree. bool Remove(const Key& key); + // Remove all keys from the tree. + void Clear() { ResetRoot(); } + bool is_empty() { return root_ == NULL; } // Perform the splay operation for the given key. Moves the node with |