mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
Kernel: Reduce LOCK_DEBUG ifdefs by utilizing Kernel::LockLocation
The LOCK_DEBUG conditional code is pretty ugly for a feature that we only use rarely. We can remove a significant amount of this code by utilizing a zero sized fake type when not building in LOCK_DEBUG mode. This lets us keep the same API, but just let the compiler optimize it away when don't actually care about the location the caller came from.
This commit is contained in:
committed by
Andreas Kling
parent
6c18b4e558
commit
bea74f4b77
@@ -514,7 +514,7 @@ void Thread::finalize()
|
||||
dbgln("Thread {} leaking {} Locks!", *this, lock_count());
|
||||
ScopedSpinLock list_lock(m_holding_locks_lock);
|
||||
for (auto& info : m_holding_locks_list) {
|
||||
const auto& location = info.source_location;
|
||||
const auto& location = info.lock_location;
|
||||
dbgln(" - Mutex: \"{}\" @ {} locked in function \"{}\" at \"{}:{}\" with a count of: {}", info.lock->name(), info.lock, location.function_name(), location.filename(), location.line_number(), info.count);
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
|
||||
Reference in New Issue
Block a user