diff --git a/bpt/include/bpt/bpt_page.hpp b/bpt/include/bpt/bpt_page.hpp index 8f072c9..9c2e906 100644 --- a/bpt/include/bpt/bpt_page.hpp +++ b/bpt/include/bpt/bpt_page.hpp @@ -8,10 +8,13 @@ class BPlusTreePage { typedef std::pair value_type; page_id_t p_n; page_id_t p_parent; - unsigned char is_leaf; - const static size_t kMaxKeyCount = (kPageSize - sizeof(page_id_t) * 2 - sizeof(unsigned char)) / sizeof(value_type); + uint8_t is_leaf; + 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]; - 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) #endif // BPT_PAGE_H \ No newline at end of file diff --git a/bpt/include/bpt/config.h b/bpt/include/bpt/config.h index dbbd96c..3eec52d 100644 --- a/bpt/include/bpt/config.h +++ b/bpt/include/bpt/config.h @@ -1,8 +1,9 @@ #ifndef CONFIG_H #define CONFIG_H #include +#include 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 block_id_t; typedef default_numeric_index_t frame_id_t;