diff --git a/stasis/page/compression/compression.h b/stasis/page/compression/compression.h index 33d6b2a..f485748 100644 --- a/stasis/page/compression/compression.h +++ b/stasis/page/compression/compression.h @@ -1,8 +1,13 @@ -#include - #ifndef _ROSE_COMPRESSION_COMPRESSION_H__ #define _ROSE_COMPRESSION_COMPRESSION_H__ +#include +#define __STDC_LIMIT_MACROS 1 +#include +#ifndef UINT16_MAX // XXX should be defined in stdint.h. +#define UINT16_MAX (65535) +#endif + namespace rose { typedef int8_t record_size_t; @@ -14,9 +19,10 @@ typedef uint16_t column_offset_t; typedef uint64_t epoch_t; static const record_size_t VARIABLE_SIZE = CHAR_MAX; -static const slot_index_t NOSPACE = USHRT_MAX; //UINT_MAX; -static const slot_index_t EXCEPTIONAL = USHRT_MAX-1;//UINT_MAX-1; -static const slot_index_t MAX_INDEX = USHRT_MAX-2;//UINT_MAX-2; + +static const slot_index_t NOSPACE = UINT16_MAX; +static const slot_index_t EXCEPTIONAL = UINT16_MAX-1; +static const slot_index_t MAX_INDEX = UINT16_MAX-2; static const slot_index_t INVALID_COL = UCHAR_MAX; /** This function computes a page type (an integer stored in the page header) diff --git a/stasis/page/compression/rle.h b/stasis/page/compression/rle.h index c5e91fd..e0e94f1 100644 --- a/stasis/page/compression/rle.h +++ b/stasis/page/compression/rle.h @@ -14,11 +14,13 @@ template class Rle { public: - typedef uint32_t block_index_t; - typedef uint16_t copy_count_t; + /** XXX this stuff is performance critical; should be template param.*/ + typedef byte_off_t block_index_t; + typedef uint8_t copy_count_t; + static const copy_count_t MAX_COPY_COUNT = UCHAR_MAX; + typedef TYPE TYP; - static const copy_count_t MAX_COPY_COUNT = USHRT_MAX; struct triple_t { slot_index_t index;