susumu.yata
null+****@clear*****
Mon Aug 19 14:13:13 JST 2013
susumu.yata 2013-08-19 14:13:13 +0900 (Mon, 19 Aug 2013) New Revision: 4902e91280d223c4ac1913079b02217d53d43c88 https://github.com/groonga/grnxx/commit/4902e91280d223c4ac1913079b02217d53d43c88 Message: Unlink an empty page if it is fixed. Modified files: lib/grnxx/map/pool.cpp Modified: lib/grnxx/map/pool.cpp (+6 -0) =================================================================== --- lib/grnxx/map/pool.cpp 2013-08-19 13:17:30 +0900 (44f032e) +++ lib/grnxx/map/pool.cpp 2013-08-19 14:13:13 +0900 (d16b416) @@ -684,6 +684,12 @@ uint64_t Pool<Bytes>::reserve_space(uint32_t size) { offset += page_size_left; } const uint32_t page_id = static_cast<uint32_t>(offset / PAGE_SIZE); + if (page_id > 0) { + if (table_[page_id - 1].size_in_use == 0) { + // Unlink an empty page if it is fixed. + storage_->unlink_node(table_[page_id - 1].page_storage_node_id); + } + } if (!pages_[page_id]) { // Note that "pages_[0]" is not nullptr if there is a small-size page // because it is opened in refresh_page(). -------------- next part -------------- HTML����������������������������...Download