mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:42:43 +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:
		
							parent
							
								
									6c18b4e558
								
							
						
					
					
						commit
						bea74f4b77
					
				
					 4 changed files with 13 additions and 53 deletions
				
			
		|  | @ -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(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Brian Gianforcaro
						Brian Gianforcaro