Skip to content

Commit

Permalink
os/bluestore: silence StupidAllocator reorder warning
Browse files Browse the repository at this point in the history
warning: ‘StupidAllocator::last_alloc’ will be initialized after [-Wreorder]

Signed-off-by: Jos Collin <[email protected]>
  • Loading branch information
joscollin authored and mkogan1 committed Sep 5, 2019
1 parent 2a9a0ee commit 960a8e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/os/bluestore/StupidAllocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ StupidAllocator::StupidAllocator(CephContext* cct,
const std::string& name,
int64_t _block_size)
: Allocator(name), cct(cct), num_free(0),
free(10),
last_alloc(0),
block_size(_block_size)
block_size(_block_size),
free(10)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/bluestore/StupidAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class StupidAllocator : public Allocator {
typedef interval_set<uint64_t,interval_set_map_t> interval_set_t;
std::vector<interval_set_t> free; ///< leading-edge copy

uint64_t last_alloc;
uint64_t last_alloc = 0;

unsigned _choose_bin(uint64_t len);
void _insert_free(uint64_t offset, uint64_t len);
Expand Down

0 comments on commit 960a8e5

Please sign in to comment.