diff --git a/benchmarks/rose.cpp b/benchmarks/rose.cpp index 16dd02a..6d903e6 100644 --- a/benchmarks/rose.cpp +++ b/benchmarks/rose.cpp @@ -6,6 +6,10 @@ #include +#define DEFINED_VAL_T + +//typedef int32_t val_t; // rose executable's input contains 32 bit values +typedef int64_t val_t; // rose executable's input contains 64 bit values #include "stasis/page/compression/for-impl.h" #include "stasis/page/compression/pstar-impl.h" #include "stasis/page/compression/rle-impl.h" @@ -14,8 +18,6 @@ #include "stasis/operations/lsmIterators.h" -typedef int32_t val_t; // XXX needed by lsmWorkers.. - #include "stasis/operations/lsmWorkers.h" #undef end diff --git a/src/stasis/operations/lsmIterators.h b/src/stasis/operations/lsmIterators.h index ff5772b..d39773c 100644 --- a/src/stasis/operations/lsmIterators.h +++ b/src/stasis/operations/lsmIterators.h @@ -484,10 +484,12 @@ template return toByteArray(&t->a_); } +#ifdef DEFINED_VAL_T template -inline const byte* toByteArray(treeIterator *const t) { +inline const byte* toByteArray(treeIterator *const t) { return (const byte*)&(**t); } +#endif template inline const byte* toByteArray(treeIterator *const t) { return (**t).toByteArray(); diff --git a/src/stasis/operations/lsmWorkers.h b/src/stasis/operations/lsmWorkers.h index 02b95be..33af312 100644 --- a/src/stasis/operations/lsmWorkers.h +++ b/src/stasis/operations/lsmWorkers.h @@ -15,7 +15,7 @@ namespace rose { cast from a TYPE to a byte *. These were written to make it easier to write templates that work with different types of iterators. */ -inline const byte * toByteArray(int const *const *const i) { +inline const byte * toByteArray(val_t const *const *const i) { return (const byte*)*i; } inline const byte * toByteArray(Tuple::iterator * const t) { @@ -25,7 +25,7 @@ inline const byte * toByteArray(Tuple::iterator * const t) { template struct insert_args { int comparator_idx; - int rowsize;typedef int32_t val_t; + int rowsize; ITER *begin; ITER *end; pageid_t(*pageAlloc)(int,void*);