Skip to content

Commit

Permalink
fix free blocks allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
koolkdev committed Feb 14, 2024
1 parent 32eab20 commit 9a9d2c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/free_blocks_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
#include "free_blocks_allocator.h"

FreeBlocksAllocator::FreeBlocksAllocator(std::shared_ptr<const Area> area, std::shared_ptr<MetadataBlock> root_block)
: area_(area), tree_{Adapter{area}, root_block->BlockNumber()}, root_block_(std::move(root_block)) {}
: area_(area),
tree_{Adapter{area}, area->RelativeBlockNumber(root_block->BlockNumber())},
root_block_(std::move(root_block)) {}
3 changes: 2 additions & 1 deletion src/free_blocks_allocator_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ class EPTreeIterator {

template <std::size_t N, std::size_t... Is>
std::array<FTree<Block>, N> CreateFTreeArray(uint32_t block_number, std::index_sequence<Is...>) {
return {{FTree(blocks_retriever_.get_block(block_number), Is)...}};
auto block = blocks_retriever_.get_block(block_number);
return {{FTree(block, Is)...}};
}

value_type operator*() {
Expand Down

0 comments on commit 9a9d2c0

Please sign in to comment.