1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-03 05:41:09 +03:00
All function names that started with __toku_ now start with
toku__
We no longer have function symbols that start with '__'

git-svn-id: file:///svn/tokudb@2623 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Yoni Fogel
2008-03-07 20:11:27 +00:00
parent 4af7f162dc
commit e6e8a736be
9 changed files with 244 additions and 244 deletions

View File

@@ -17,12 +17,12 @@
/* TODO: reallocate the hash table if it grows too big. Perhaps, use toku_get_prime in newbrt/primes.c */
const uint32 __toku_lth_init_size = 521;
static inline uint32 __toku_lth_hash(toku_lth* table, toku_lock_tree* key) {
static inline uint32 toku__lth_hash(toku_lth* table, toku_lock_tree* key) {
size_t tmp = (size_t)key;
return tmp % table->array_size;
}
static inline void __toku_invalidate_scan(toku_lth* table) {
static inline void toku__invalidate_scan(toku_lth* table) {
table->finger_end = TRUE;
}
@@ -45,7 +45,7 @@ int toku_lth_create(toku_lth** ptable,
tmp->malloc(tmp->array_size * sizeof(*tmp->table));
if (!tmp->table) { r = errno; goto died1; }
memset(tmp->table, 0, tmp->array_size * sizeof(*tmp->table));
__toku_invalidate_scan(tmp);
toku__invalidate_scan(tmp);
*ptable = tmp;
return 0;
}
@@ -53,7 +53,7 @@ int toku_lth_create(toku_lth** ptable,
toku_lock_tree* toku_lth_find(toku_lth* table, toku_lock_tree* key) {
assert(table && key);
uint32 index = __toku_lth_hash(table, key);
uint32 index = toku__lth_hash(table, key);
toku_lth_elt* element = table->table[index];
while (element && element->key != key) element = element->next;
return element ? element->key : NULL;
@@ -67,7 +67,7 @@ void toku_lth_start_scan(toku_lth* table) {
table->finger_end = FALSE;
}
static inline toku_lth_elt* __toku_lth_next(toku_lth* table) {
static inline toku_lth_elt* toku__lth_next(toku_lth* table) {
assert(table);
assert(!table->finger_end);
@@ -84,19 +84,19 @@ static inline toku_lth_elt* __toku_lth_next(toku_lth* table) {
toku_lock_tree* toku_lth_next(toku_lth* table) {
assert(table);
toku_lth_elt* next = __toku_lth_next(table);
toku_lth_elt* next = toku__lth_next(table);
return next ? next->key : NULL;
}
/* Element MUST exist. */
void toku_lth_delete(toku_lth* table, toku_lock_tree* key) {
assert(table && key);
__toku_invalidate_scan(table);
toku__invalidate_scan(table);
/* Must have elements. */
assert(table->num_keys);
uint32 index = __toku_lth_hash(table, key);
uint32 index = toku__lth_hash(table, key);
toku_lth_elt* element = table->table[index];
/* Elements of the right hash must exist. */
@@ -126,9 +126,9 @@ void toku_lth_delete(toku_lth* table, toku_lock_tree* key) {
/* Will allow you to insert it over and over. You need to keep track. */
int toku_lth_insert(toku_lth* table, toku_lock_tree* key) {
assert(table && key);
__toku_invalidate_scan(table);
toku__invalidate_scan(table);
uint32 index = __toku_lth_hash(table, key);
uint32 index = toku__lth_hash(table, key);
/* Allocate a new one. */
toku_lth_elt* element = (toku_lth_elt*)table->malloc(sizeof(*element));
@@ -147,10 +147,10 @@ void toku_lth_close(toku_lth* table) {
toku_lth_elt* next = NULL;
toku_lth_start_scan(table);
next = __toku_lth_next(table);
next = toku__lth_next(table);
while (next) {
element = next;
next = __toku_lth_next(table);
next = toku__lth_next(table);
table->free(element);
}