Commit 2a4dabdc authored by Vincenzo Liberatore's avatar Vincenzo Liberatore

Addresses #293

Addresses #307
Beautifies Makefile in tests. Fixes initialization of hash table scanning.


git-svn-id: file:///svn/tokudb@2080 c7de825b-a66e-492c-adef-691d508d4ae1
parent 063a10e0
...@@ -63,6 +63,7 @@ void toku_rth_start_scan(toku_rth* table) { ...@@ -63,6 +63,7 @@ void toku_rth_start_scan(toku_rth* table) {
assert(table); assert(table);
table->finger_index = 0; table->finger_index = 0;
table->finger_ptr = table->table[table->finger_index]; table->finger_ptr = table->table[table->finger_index];
table->finger_start = TRUE;
table->finger_end = FALSE; table->finger_end = FALSE;
} }
...@@ -70,11 +71,14 @@ static inline toku_rth_elt* __toku_rth_next(toku_rth* table) { ...@@ -70,11 +71,14 @@ static inline toku_rth_elt* __toku_rth_next(toku_rth* table) {
assert(table); assert(table);
assert(!table->finger_end); assert(!table->finger_end);
if (table->finger_ptr) table->finger_ptr = table->finger_ptr->next; if (table->finger_ptr && !table->finger_start) {
table->finger_ptr = table->finger_ptr->next;
}
while (!table->finger_ptr && ++table->finger_index < table->array_size) { while (!table->finger_ptr && ++table->finger_index < table->array_size) {
table->finger_ptr = table->table[table->finger_index]; table->finger_ptr = table->table[table->finger_index];
} }
table->finger_end = !table->finger_ptr; table->finger_start = FALSE;
table->finger_end = !table->finger_ptr;
return table->finger_ptr; return table->finger_ptr;
} }
......
...@@ -36,6 +36,7 @@ struct __toku_rth { ...@@ -36,6 +36,7 @@ struct __toku_rth {
uint32 array_size; uint32 array_size;
uint32 finger_index; uint32 finger_index;
toku_rth_elt* finger_ptr; toku_rth_elt* finger_ptr;
BOOL finger_start;
BOOL finger_end; BOOL finger_end;
/** The user malloc function */ /** The user malloc function */
void* (*malloc) (size_t); void* (*malloc) (size_t);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# make VERBOSE=2 # make VERBOSE=2
OPTFLAGS = -O0 OPTFLAGS = -O0
ifeq ($(OSX),OSX) ifneq ($(OSX),)
#Note: OSX 10.4 needs DYLD_LIBRARY_PATH. OSX 10.5 claims to support -rpath. #Note: OSX 10.4 needs DYLD_LIBRARY_PATH. OSX 10.5 claims to support -rpath.
LIBEXT=dylib LIBEXT=dylib
VGRIND= VGRIND=
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment