Mess with some of the typedefs for better code clarity, and (hopefully) better real-world compression.

This commit is contained in:
Sears Russell 2008-05-27 07:33:35 +00:00
parent a4c29b95a2
commit 690ebdea9a
2 changed files with 16 additions and 8 deletions

View file

@ -1,8 +1,13 @@
#include <limits.h>
#ifndef _ROSE_COMPRESSION_COMPRESSION_H__
#define _ROSE_COMPRESSION_COMPRESSION_H__
#include <limits.h>
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>
#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)

View file

@ -14,11 +14,13 @@ template <class TYPE>
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;