better set the length of int
This commit is contained in:
@ -8,10 +8,13 @@ class BPlusTreePage {
|
|||||||
typedef std::pair<KeyType, b_plus_tree_value_index_t> value_type;
|
typedef std::pair<KeyType, b_plus_tree_value_index_t> value_type;
|
||||||
page_id_t p_n;
|
page_id_t p_n;
|
||||||
page_id_t p_parent;
|
page_id_t p_parent;
|
||||||
unsigned char is_leaf;
|
uint8_t is_leaf;
|
||||||
const static size_t kMaxKeyCount = (kPageSize - sizeof(page_id_t) * 2 - sizeof(unsigned char)) / sizeof(value_type);
|
uint16_t key_count;
|
||||||
|
const static size_t kMaxKeyCount =
|
||||||
|
(kPageSize - sizeof(page_id_t) * 2 - sizeof(uint8_t) - sizeof(uint16_t)) / sizeof(value_type);
|
||||||
value_type p_data[kMaxKeyCount];
|
value_type p_data[kMaxKeyCount];
|
||||||
char filler[kPageSize - sizeof(page_id_t) * 2 - sizeof(unsigned char) - sizeof(value_type) * kMaxKeyCount];
|
char filler[kPageSize - sizeof(page_id_t) * 2 - sizeof(uint8_t) - sizeof(uint16_t) -
|
||||||
|
sizeof(value_type) * kMaxKeyCount];
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
#endif // BPT_PAGE_H
|
#endif // BPT_PAGE_H
|
@ -1,8 +1,9 @@
|
|||||||
#ifndef CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cstdint>
|
||||||
extern const size_t kPageSize;
|
extern const size_t kPageSize;
|
||||||
typedef unsigned int default_numeric_index_t;
|
typedef uint32_t default_numeric_index_t;
|
||||||
typedef default_numeric_index_t page_id_t;
|
typedef default_numeric_index_t page_id_t;
|
||||||
typedef default_numeric_index_t block_id_t;
|
typedef default_numeric_index_t block_id_t;
|
||||||
typedef default_numeric_index_t frame_id_t;
|
typedef default_numeric_index_t frame_id_t;
|
||||||
|
Reference in New Issue
Block a user