Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Unified Diff: src/splay-tree-inl.h

Issue 10534006: Remove TLS access for current Zone. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/splay-tree.h ('k') | src/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/splay-tree-inl.h
diff --git a/src/splay-tree-inl.h b/src/splay-tree-inl.h
index bb6ded7098b78d8f384e084e3d4adb88d9d6c7a7..4eca71d1004f10ad49b9515c825fb4babc9e4e9a 100644
--- a/src/splay-tree-inl.h
+++ b/src/splay-tree-inl.h
@@ -43,11 +43,10 @@ SplayTree<Config, Allocator>::~SplayTree() {
template<typename Config, class Allocator>
bool SplayTree<Config, Allocator>::Insert(const Key& key,
- Locator* locator,
- Allocator allocator) {
+ Locator* locator) {
if (is_empty()) {
// If the tree is empty, insert the new node.
- root_ = new(allocator) Node(key, Config::NoValue());
+ root_ = new(allocator_) Node(key, Config::NoValue());
} else {
// Splay on the key to move the last node on the search path
// for the key to the root of the tree.
@@ -59,7 +58,7 @@ bool SplayTree<Config, Allocator>::Insert(const Key& key,
return false;
}
// Insert the new node.
- Node* node = new(allocator) Node(key, Config::NoValue());
+ Node* node = new(allocator_) Node(key, Config::NoValue());
InsertInternal(cmp, node);
}
locator->bind(root_);
@@ -293,16 +292,15 @@ void SplayTree<Config, Allocator>::ForEach(Callback* callback) {
template <typename Config, class Allocator> template <class Callback>
-void SplayTree<Config, Allocator>::ForEachNode(Callback* callback,
- Allocator allocator) {
+void SplayTree<Config, Allocator>::ForEachNode(Callback* callback) {
// Pre-allocate some space for tiny trees.
- List<Node*, Allocator> nodes_to_visit(10);
- if (root_ != NULL) nodes_to_visit.Add(root_, allocator);
+ List<Node*, Allocator> nodes_to_visit(10, allocator_);
+ if (root_ != NULL) nodes_to_visit.Add(root_, allocator_);
int pos = 0;
while (pos < nodes_to_visit.length()) {
Node* node = nodes_to_visit[pos++];
- if (node->left() != NULL) nodes_to_visit.Add(node->left(), allocator);
- if (node->right() != NULL) nodes_to_visit.Add(node->right(), allocator);
+ if (node->left() != NULL) nodes_to_visit.Add(node->left(), allocator_);
+ if (node->right() != NULL) nodes_to_visit.Add(node->right(), allocator_);
callback->Call(node);
}
}
« no previous file with comments | « src/splay-tree.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698