aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ext/filters/client_channel/retry_throttle.cc16
-rw-r--r--src/core/ext/filters/client_channel/subchannel_index.cc46
-rw-r--r--src/core/lib/avl/avl.cc (renamed from src/core/lib/gpr/avl.cc)100
-rw-r--r--src/core/lib/avl/avl.h (renamed from src/core/lib/gpr/avl.h)48
4 files changed, 105 insertions, 105 deletions
diff --git a/src/core/ext/filters/client_channel/retry_throttle.cc b/src/core/ext/filters/client_channel/retry_throttle.cc
index 20d7be1c21..f632a02cde 100644
--- a/src/core/ext/filters/client_channel/retry_throttle.cc
+++ b/src/core/ext/filters/client_channel/retry_throttle.cc
@@ -26,7 +26,7 @@
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
-#include "src/core/lib/gpr/avl.h"
+#include "src/core/lib/avl/avl.h"
//
// server_retry_throttle_data
@@ -153,7 +153,7 @@ static void* copy_server_retry_throttle_data(void* value, void* unused) {
static void destroy_server_name(void* key, void* unused) { gpr_free(key); }
-static const gpr_avl_vtable avl_vtable = {
+static const grpc_avl_vtable avl_vtable = {
destroy_server_name, copy_server_name, compare_server_name,
destroy_server_retry_throttle_data, copy_server_retry_throttle_data};
@@ -162,29 +162,29 @@ static const gpr_avl_vtable avl_vtable = {
//
static gpr_mu g_mu;
-static gpr_avl g_avl;
+static grpc_avl g_avl;
void grpc_retry_throttle_map_init() {
gpr_mu_init(&g_mu);
- g_avl = gpr_avl_create(&avl_vtable);
+ g_avl = grpc_avl_create(&avl_vtable);
}
void grpc_retry_throttle_map_shutdown() {
gpr_mu_destroy(&g_mu);
- gpr_avl_unref(g_avl, nullptr);
+ grpc_avl_unref(g_avl, nullptr);
}
grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server(
const char* server_name, int max_milli_tokens, int milli_token_ratio) {
gpr_mu_lock(&g_mu);
grpc_server_retry_throttle_data* throttle_data =
- (grpc_server_retry_throttle_data*)gpr_avl_get(g_avl, (char*)server_name,
+ (grpc_server_retry_throttle_data*)grpc_avl_get(g_avl, (char*)server_name,
nullptr);
if (throttle_data == nullptr) {
// Entry not found. Create a new one.
throttle_data = grpc_server_retry_throttle_data_create(
max_milli_tokens, milli_token_ratio, nullptr);
- g_avl = gpr_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
+ g_avl = grpc_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
} else {
if (throttle_data->max_milli_tokens != max_milli_tokens ||
throttle_data->milli_token_ratio != milli_token_ratio) {
@@ -192,7 +192,7 @@ grpc_server_retry_throttle_data* grpc_retry_throttle_map_get_data_for_server(
// the original one.
throttle_data = grpc_server_retry_throttle_data_create(
max_milli_tokens, milli_token_ratio, throttle_data);
- g_avl = gpr_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
+ g_avl = grpc_avl_add(g_avl, (char*)server_name, throttle_data, nullptr);
} else {
// Entry found. Increase refcount.
grpc_server_retry_throttle_data_ref(throttle_data);
diff --git a/src/core/ext/filters/client_channel/subchannel_index.cc b/src/core/ext/filters/client_channel/subchannel_index.cc
index 2d063973ca..8687291bbe 100644
--- a/src/core/ext/filters/client_channel/subchannel_index.cc
+++ b/src/core/ext/filters/client_channel/subchannel_index.cc
@@ -26,11 +26,11 @@
#include <grpc/support/tls.h>
#include "src/core/lib/channel/channel_args.h"
-#include "src/core/lib/gpr/avl.h"
+#include "src/core/lib/avl/avl.h"
// a map of subchannel_key --> subchannel, used for detecting connections
// to the same destination in order to share them
-static gpr_avl g_subchannel_index;
+static grpc_avl g_subchannel_index;
static gpr_mu g_mu;
@@ -109,7 +109,7 @@ static void* scv_avl_copy(void* p, void* unused) {
return p;
}
-static const gpr_avl_vtable subchannel_avl_vtable = {
+static const grpc_avl_vtable subchannel_avl_vtable = {
sck_avl_destroy, // destroy_key
sck_avl_copy, // copy_key
sck_avl_compare, // compare_keys
@@ -118,7 +118,7 @@ static const gpr_avl_vtable subchannel_avl_vtable = {
};
void grpc_subchannel_index_init(void) {
- g_subchannel_index = gpr_avl_create(&subchannel_avl_vtable);
+ g_subchannel_index = grpc_avl_create(&subchannel_avl_vtable);
gpr_mu_init(&g_mu);
gpr_ref_init(&g_refcount, 1);
}
@@ -133,7 +133,7 @@ void grpc_subchannel_index_shutdown(void) {
void grpc_subchannel_index_unref(void) {
if (gpr_unref(&g_refcount)) {
gpr_mu_destroy(&g_mu);
- gpr_avl_unref(g_subchannel_index, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(g_subchannel_index, grpc_core::ExecCtx::Get());
}
}
@@ -143,13 +143,13 @@ grpc_subchannel* grpc_subchannel_index_find(grpc_subchannel_key* key) {
// Lock, and take a reference to the subchannel index.
// We don't need to do the search under a lock as avl's are immutable.
gpr_mu_lock(&g_mu);
- gpr_avl index = gpr_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
+ grpc_avl index = grpc_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
gpr_mu_unlock(&g_mu);
grpc_subchannel* c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(
- (grpc_subchannel*)gpr_avl_get(index, key, grpc_core::ExecCtx::Get()),
+ (grpc_subchannel*)grpc_avl_get(index, key, grpc_core::ExecCtx::Get()),
"index_find");
- gpr_avl_unref(index, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(index, grpc_core::ExecCtx::Get());
return c;
}
@@ -165,11 +165,11 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_subchannel_key* key,
// Compare and swap loop:
// - take a reference to the current index
gpr_mu_lock(&g_mu);
- gpr_avl index = gpr_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
+ grpc_avl index = grpc_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
gpr_mu_unlock(&g_mu);
// - Check to see if a subchannel already exists
- c = (grpc_subchannel*)gpr_avl_get(index, key, grpc_core::ExecCtx::Get());
+ c = (grpc_subchannel*)grpc_avl_get(index, key, grpc_core::ExecCtx::Get());
if (c != nullptr) {
c = GRPC_SUBCHANNEL_REF_FROM_WEAK_REF(c, "index_register");
}
@@ -178,8 +178,8 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_subchannel_key* key,
need_to_unref_constructed = true;
} else {
// no -> update the avl and compare/swap
- gpr_avl updated =
- gpr_avl_add(gpr_avl_ref(index, grpc_core::ExecCtx::Get()),
+ grpc_avl updated =
+ grpc_avl_add(grpc_avl_ref(index, grpc_core::ExecCtx::Get()),
subchannel_key_copy(key),
GRPC_SUBCHANNEL_WEAK_REF(constructed, "index_register"),
grpc_core::ExecCtx::Get());
@@ -189,14 +189,14 @@ grpc_subchannel* grpc_subchannel_index_register(grpc_subchannel_key* key,
// compare/swap here to check that, and retry as necessary
gpr_mu_lock(&g_mu);
if (index.root == g_subchannel_index.root) {
- GPR_SWAP(gpr_avl, updated, g_subchannel_index);
+ GPR_SWAP(grpc_avl, updated, g_subchannel_index);
c = constructed;
}
gpr_mu_unlock(&g_mu);
- gpr_avl_unref(updated, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(updated, grpc_core::ExecCtx::Get());
}
- gpr_avl_unref(index, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(index, grpc_core::ExecCtx::Get());
}
if (need_to_unref_constructed) {
@@ -213,33 +213,33 @@ void grpc_subchannel_index_unregister(grpc_subchannel_key* key,
// Compare and swap loop:
// - take a reference to the current index
gpr_mu_lock(&g_mu);
- gpr_avl index = gpr_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
+ grpc_avl index = grpc_avl_ref(g_subchannel_index, grpc_core::ExecCtx::Get());
gpr_mu_unlock(&g_mu);
// Check to see if this key still refers to the previously
// registered subchannel
grpc_subchannel* c =
- (grpc_subchannel*)gpr_avl_get(index, key, grpc_core::ExecCtx::Get());
+ (grpc_subchannel*)grpc_avl_get(index, key, grpc_core::ExecCtx::Get());
if (c != constructed) {
- gpr_avl_unref(index, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(index, grpc_core::ExecCtx::Get());
break;
}
// compare and swap the update (some other thread may have
// mutated the index behind us)
- gpr_avl updated =
- gpr_avl_remove(gpr_avl_ref(index, grpc_core::ExecCtx::Get()), key,
+ grpc_avl updated =
+ grpc_avl_remove(grpc_avl_ref(index, grpc_core::ExecCtx::Get()), key,
grpc_core::ExecCtx::Get());
gpr_mu_lock(&g_mu);
if (index.root == g_subchannel_index.root) {
- GPR_SWAP(gpr_avl, updated, g_subchannel_index);
+ GPR_SWAP(grpc_avl, updated, g_subchannel_index);
done = true;
}
gpr_mu_unlock(&g_mu);
- gpr_avl_unref(updated, grpc_core::ExecCtx::Get());
- gpr_avl_unref(index, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(updated, grpc_core::ExecCtx::Get());
+ grpc_avl_unref(index, grpc_core::ExecCtx::Get());
}
}
diff --git a/src/core/lib/gpr/avl.cc b/src/core/lib/avl/avl.cc
index 9d3470fe0a..959d12fe3a 100644
--- a/src/core/lib/gpr/avl.cc
+++ b/src/core/lib/avl/avl.cc
@@ -16,7 +16,7 @@
*
*/
-#include "src/core/lib/gpr/avl.h"
+#include "src/core/lib/avl/avl.h"
#include <assert.h>
#include <stdlib.h>
@@ -26,21 +26,21 @@
#include "src/core/lib/gpr/useful.h"
-gpr_avl gpr_avl_create(const gpr_avl_vtable* vtable) {
- gpr_avl out;
+grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable) {
+ grpc_avl out;
out.vtable = vtable;
out.root = nullptr;
return out;
}
-static gpr_avl_node* ref_node(gpr_avl_node* node) {
+static grpc_avl_node* ref_node(grpc_avl_node* node) {
if (node) {
gpr_ref(&node->refs);
}
return node;
}
-static void unref_node(const gpr_avl_vtable* vtable, gpr_avl_node* node,
+static void unref_node(const grpc_avl_vtable* vtable, grpc_avl_node* node,
void* user_data) {
if (node == nullptr) {
return;
@@ -54,18 +54,18 @@ static void unref_node(const gpr_avl_vtable* vtable, gpr_avl_node* node,
}
}
-static long node_height(gpr_avl_node* node) {
+static long node_height(grpc_avl_node* node) {
return node == nullptr ? 0 : node->height;
}
#ifndef NDEBUG
-static long calculate_height(gpr_avl_node* node) {
+static long calculate_height(grpc_avl_node* node) {
return node == nullptr ? 0
: 1 + GPR_MAX(calculate_height(node->left),
calculate_height(node->right));
}
-static gpr_avl_node* assert_invariants(gpr_avl_node* n) {
+static grpc_avl_node* assert_invariants(grpc_avl_node* n) {
if (n == nullptr) return nullptr;
assert_invariants(n->left);
assert_invariants(n->right);
@@ -74,12 +74,12 @@ static gpr_avl_node* assert_invariants(gpr_avl_node* n) {
return n;
}
#else
-static gpr_avl_node* assert_invariants(gpr_avl_node* n) { return n; }
+static grpc_avl_node* assert_invariants(grpc_avl_node* n) { return n; }
#endif
-gpr_avl_node* new_node(void* key, void* value, gpr_avl_node* left,
- gpr_avl_node* right) {
- gpr_avl_node* node = (gpr_avl_node*)gpr_malloc(sizeof(*node));
+grpc_avl_node* new_node(void* key, void* value, grpc_avl_node* left,
+ grpc_avl_node* right) {
+ grpc_avl_node* node = (grpc_avl_node*)gpr_malloc(sizeof(*node));
gpr_ref_init(&node->refs, 1);
node->key = key;
node->value = value;
@@ -89,7 +89,7 @@ gpr_avl_node* new_node(void* key, void* value, gpr_avl_node* left,
return node;
}
-static gpr_avl_node* get(const gpr_avl_vtable* vtable, gpr_avl_node* node,
+static grpc_avl_node* get(const grpc_avl_vtable* vtable, grpc_avl_node* node,
void* key, void* user_data) {
long cmp;
@@ -107,13 +107,13 @@ static gpr_avl_node* get(const gpr_avl_vtable* vtable, gpr_avl_node* node,
}
}
-void* gpr_avl_get(gpr_avl avl, void* key, void* user_data) {
- gpr_avl_node* node = get(avl.vtable, avl.root, key, user_data);
+void* grpc_avl_get(grpc_avl avl, void* key, void* user_data) {
+ grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
return node ? node->value : nullptr;
}
-int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value, void* user_data) {
- gpr_avl_node* node = get(avl.vtable, avl.root, key, user_data);
+int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data) {
+ grpc_avl_node* node = get(avl.vtable, avl.root, key, user_data);
if (node != nullptr) {
*value = node->value;
return 1;
@@ -121,10 +121,10 @@ int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value, void* user_data) {
return 0;
}
-static gpr_avl_node* rotate_left(const gpr_avl_vtable* vtable, void* key,
- void* value, gpr_avl_node* left,
- gpr_avl_node* right, void* user_data) {
- gpr_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
+static grpc_avl_node* rotate_left(const grpc_avl_vtable* vtable, void* key,
+ void* value, grpc_avl_node* left,
+ grpc_avl_node* right, void* user_data) {
+ grpc_avl_node* n = new_node(vtable->copy_key(right->key, user_data),
vtable->copy_value(right->value, user_data),
new_node(key, value, left, ref_node(right->left)),
ref_node(right->right));
@@ -132,10 +132,10 @@ static gpr_avl_node* rotate_left(const gpr_avl_vtable* vtable, void* key,
return n;
}
-static gpr_avl_node* rotate_right(const gpr_avl_vtable* vtable, void* key,
- void* value, gpr_avl_node* left,
- gpr_avl_node* right, void* user_data) {
- gpr_avl_node* n =
+static grpc_avl_node* rotate_right(const grpc_avl_vtable* vtable, void* key,
+ void* value, grpc_avl_node* left,
+ grpc_avl_node* right, void* user_data) {
+ grpc_avl_node* n =
new_node(vtable->copy_key(left->key, user_data),
vtable->copy_value(left->value, user_data), ref_node(left->left),
new_node(key, value, ref_node(left->right), right));
@@ -143,11 +143,11 @@ static gpr_avl_node* rotate_right(const gpr_avl_vtable* vtable, void* key,
return n;
}
-static gpr_avl_node* rotate_left_right(const gpr_avl_vtable* vtable, void* key,
- void* value, gpr_avl_node* left,
- gpr_avl_node* right, void* user_data) {
+static grpc_avl_node* rotate_left_right(const grpc_avl_vtable* vtable, void* key,
+ void* value, grpc_avl_node* left,
+ grpc_avl_node* right, void* user_data) {
/* rotate_right(..., rotate_left(left), right) */
- gpr_avl_node* n =
+ grpc_avl_node* n =
new_node(vtable->copy_key(left->right->key, user_data),
vtable->copy_value(left->right->value, user_data),
new_node(vtable->copy_key(left->key, user_data),
@@ -158,11 +158,11 @@ static gpr_avl_node* rotate_left_right(const gpr_avl_vtable* vtable, void* key,
return n;
}
-static gpr_avl_node* rotate_right_left(const gpr_avl_vtable* vtable, void* key,
- void* value, gpr_avl_node* left,
- gpr_avl_node* right, void* user_data) {
+static grpc_avl_node* rotate_right_left(const grpc_avl_vtable* vtable, void* key,
+ void* value, grpc_avl_node* left,
+ grpc_avl_node* right, void* user_data) {
/* rotate_left(..., left, rotate_right(right)) */
- gpr_avl_node* n =
+ grpc_avl_node* n =
new_node(vtable->copy_key(right->left->key, user_data),
vtable->copy_value(right->left->value, user_data),
new_node(key, value, left, ref_node(right->left->left)),
@@ -173,9 +173,9 @@ static gpr_avl_node* rotate_right_left(const gpr_avl_vtable* vtable, void* key,
return n;
}
-static gpr_avl_node* rebalance(const gpr_avl_vtable* vtable, void* key,
- void* value, gpr_avl_node* left,
- gpr_avl_node* right, void* user_data) {
+static grpc_avl_node* rebalance(const grpc_avl_vtable* vtable, void* key,
+ void* value, grpc_avl_node* left,
+ grpc_avl_node* right, void* user_data) {
switch (node_height(left) - node_height(right)) {
case 2:
if (node_height(left->left) - node_height(left->right) == -1) {
@@ -198,7 +198,7 @@ static gpr_avl_node* rebalance(const gpr_avl_vtable* vtable, void* key,
}
}
-static gpr_avl_node* add_key(const gpr_avl_vtable* vtable, gpr_avl_node* node,
+static grpc_avl_node* add_key(const grpc_avl_vtable* vtable, grpc_avl_node* node,
void* key, void* value, void* user_data) {
long cmp;
if (node == nullptr) {
@@ -220,30 +220,30 @@ static gpr_avl_node* add_key(const gpr_avl_vtable* vtable, gpr_avl_node* node,
}
}
-gpr_avl gpr_avl_add(gpr_avl avl, void* key, void* value, void* user_data) {
- gpr_avl_node* old_root = avl.root;
+grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data) {
+ grpc_avl_node* old_root = avl.root;
avl.root = add_key(avl.vtable, avl.root, key, value, user_data);
assert_invariants(avl.root);
unref_node(avl.vtable, old_root, user_data);
return avl;
}
-static gpr_avl_node* in_order_head(gpr_avl_node* node) {
+static grpc_avl_node* in_order_head(grpc_avl_node* node) {
while (node->left != nullptr) {
node = node->left;
}
return node;
}
-static gpr_avl_node* in_order_tail(gpr_avl_node* node) {
+static grpc_avl_node* in_order_tail(grpc_avl_node* node) {
while (node->right != nullptr) {
node = node->right;
}
return node;
}
-static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
- gpr_avl_node* node, void* key,
+static grpc_avl_node* remove_key(const grpc_avl_vtable* vtable,
+ grpc_avl_node* node, void* key,
void* user_data) {
long cmp;
if (node == nullptr) {
@@ -256,13 +256,13 @@ static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
} else if (node->right == nullptr) {
return ref_node(node->left);
} else if (node->left->height < node->right->height) {
- gpr_avl_node* h = in_order_head(node->right);
+ grpc_avl_node* h = in_order_head(node->right);
return rebalance(
vtable, vtable->copy_key(h->key, user_data),
vtable->copy_value(h->value, user_data), ref_node(node->left),
remove_key(vtable, node->right, h->key, user_data), user_data);
} else {
- gpr_avl_node* h = in_order_tail(node->left);
+ grpc_avl_node* h = in_order_tail(node->left);
return rebalance(vtable, vtable->copy_key(h->key, user_data),
vtable->copy_value(h->value, user_data),
remove_key(vtable, node->left, h->key, user_data),
@@ -281,21 +281,21 @@ static gpr_avl_node* remove_key(const gpr_avl_vtable* vtable,
}
}
-gpr_avl gpr_avl_remove(gpr_avl avl, void* key, void* user_data) {
- gpr_avl_node* old_root = avl.root;
+grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data) {
+ grpc_avl_node* old_root = avl.root;
avl.root = remove_key(avl.vtable, avl.root, key, user_data);
assert_invariants(avl.root);
unref_node(avl.vtable, old_root, user_data);
return avl;
}
-gpr_avl gpr_avl_ref(gpr_avl avl, void* user_data) {
+grpc_avl grpc_avl_ref(grpc_avl avl, void* user_data) {
ref_node(avl.root);
return avl;
}
-void gpr_avl_unref(gpr_avl avl, void* user_data) {
+void grpc_avl_unref(grpc_avl avl, void* user_data) {
unref_node(avl.vtable, avl.root, user_data);
}
-int gpr_avl_is_empty(gpr_avl avl) { return avl.root == nullptr; }
+int grpc_avl_is_empty(grpc_avl avl) { return avl.root == nullptr; }
diff --git a/src/core/lib/gpr/avl.h b/src/core/lib/avl/avl.h
index f3ab202bb7..03d9bfd7bd 100644
--- a/src/core/lib/gpr/avl.h
+++ b/src/core/lib/avl/avl.h
@@ -16,27 +16,27 @@
*
*/
-#ifndef GRPC_CORE_LIB_GPR_AVL_H
-#define GRPC_CORE_LIB_GPR_AVL_H
+#ifndef GRPC_CORE_LIB_GRPC_AVL_H
+#define GRPC_CORE_LIB_GRPC_AVL_H
#include <grpc/support/sync.h>
/** internal node of an AVL tree */
-typedef struct gpr_avl_node {
+typedef struct grpc_avl_node {
gpr_refcount refs;
void* key;
void* value;
- struct gpr_avl_node* left;
- struct gpr_avl_node* right;
+ struct grpc_avl_node* left;
+ struct grpc_avl_node* right;
long height;
-} gpr_avl_node;
+} grpc_avl_node;
/** vtable for the AVL tree
- * The optional user_data is propagated from the top level gpr_avl_XXX API.
+ * The optional user_data is propagated from the top level grpc_avl_XXX API.
* From the same API call, multiple vtable functions may be called multiple
* times.
*/
-typedef struct gpr_avl_vtable {
+typedef struct grpc_avl_vtable {
/** destroy a key */
void (*destroy_key)(void* key, void* user_data);
/** copy a key, returning new value */
@@ -48,45 +48,45 @@ typedef struct gpr_avl_vtable {
void (*destroy_value)(void* value, void* user_data);
/** copy a value */
void* (*copy_value)(void* value, void* user_data);
-} gpr_avl_vtable;
+} grpc_avl_vtable;
/** "pointer" to an AVL tree - this is a reference
- counted object - use gpr_avl_ref to add a reference,
- gpr_avl_unref when done with a reference */
-typedef struct gpr_avl {
- const gpr_avl_vtable* vtable;
- gpr_avl_node* root;
-} gpr_avl;
+ counted object - use grpc_avl_ref to add a reference,
+ grpc_avl_unref when done with a reference */
+typedef struct grpc_avl {
+ const grpc_avl_vtable* vtable;
+ grpc_avl_node* root;
+} grpc_avl;
/** Create an immutable AVL tree. */
-gpr_avl gpr_avl_create(const gpr_avl_vtable* vtable);
+grpc_avl grpc_avl_create(const grpc_avl_vtable* vtable);
/** Add a reference to an existing tree - returns
the tree as a convenience. The optional user_data will be passed to vtable
functions. */
-gpr_avl gpr_avl_ref(gpr_avl avl, void* user_data);
+grpc_avl grpc_avl_ref(grpc_avl avl, void* user_data);
/** Remove a reference to a tree - destroying it if there
are no references left. The optional user_data will be passed to vtable
functions. */
-void gpr_avl_unref(gpr_avl avl, void* user_data);
+void grpc_avl_unref(grpc_avl avl, void* user_data);
/** Return a new tree with (key, value) added to avl.
implicitly unrefs avl to allow easy chaining.
if key exists in avl, the new tree's key entry updated
(i.e. a duplicate is not created). The optional user_data will be passed to
vtable functions. */
-gpr_avl gpr_avl_add(gpr_avl avl, void* key, void* value, void* user_data);
+grpc_avl grpc_avl_add(grpc_avl avl, void* key, void* value, void* user_data);
/** Return a new tree with key deleted
implicitly unrefs avl to allow easy chaining. The optional user_data will be
passed to vtable functions. */
-gpr_avl gpr_avl_remove(gpr_avl avl, void* key, void* user_data);
+grpc_avl grpc_avl_remove(grpc_avl avl, void* key, void* user_data);
/** Lookup key, and return the associated value.
Does not mutate avl.
Returns NULL if key is not found. The optional user_data will be passed to
vtable functions.*/
-void* gpr_avl_get(gpr_avl avl, void* key, void* user_data);
+void* grpc_avl_get(grpc_avl avl, void* key, void* user_data);
/** Return 1 if avl contains key, 0 otherwise; if it has the key, sets *value to
its value. The optional user_data will be passed to vtable functions. */
-int gpr_avl_maybe_get(gpr_avl avl, void* key, void** value, void* user_data);
+int grpc_avl_maybe_get(grpc_avl avl, void* key, void** value, void* user_data);
/** Return 1 if avl is empty, 0 otherwise */
-int gpr_avl_is_empty(gpr_avl avl);
+int grpc_avl_is_empty(grpc_avl avl);
-#endif /* GRPC_CORE_LIB_GPR_AVL_H */
+#endif /* GRPC_CORE_LIB_GRPC_AVL_H */