-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
wontfixThis will not be worked onThis will not be worked on
Description
void WriteBufferManager::RemoveDBFromQueue(StallInterface* wbm_stall) {
assert(wbm_stall != nullptr);
// Deallocate the removed nodes outside of the lock.
std::list<StallInterface*> cleanup;
if (enabled() && allow_stall_.load(std::memory_order_relaxed)) {
std::unique_lock<std::mutex> lock(mu_);
for (auto it = queue_.begin(); it != queue_.end();) {
auto next = std::next(it);
if (*it == wbm_stall) {
cleanup.splice(cleanup.end(), queue_, std::move(it));
}
it = next;
}
}
wbm_stall->Signal();
}gives:
/Users/wuqq/dev/rocksdb-main/memtable/write_buffer_manager.cc:174:36: warning: passing a possibly dangling pointer as argument
174 | for (auto it = queue_.begin(); it != queue_.end();) {
| ^~
/Users/wuqq/dev/rocksdb-main/memtable/write_buffer_manager.cc:177:39: note: modified here
177 | cleanup.splice(cleanup.end(), queue_, std::move(it));
| ^~~~~~Metadata
Metadata
Assignees
Labels
wontfixThis will not be worked onThis will not be worked on