mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	logging/backend: Make time_origin a class variable instead of a local static
Moves local global state into the Impl class itself and initializes it at the creation of the instance instead of in the function. This makes it nicer for weakly-ordered architectures, given the CreateEntry() class won't need to have atomic loads executed for each individual call to the CreateEntry class.
This commit is contained in:
		
							parent
							
								
									235fc348af
								
							
						
					
					
						commit
						592ec9b084
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -117,7 +117,6 @@ private: | ||||||
| 
 | 
 | ||||||
|         // matches from the beginning up to the last '../' or 'src/'
 |         // matches from the beginning up to the last '../' or 'src/'
 | ||||||
|         static const std::regex trim_source_path(R"(.*([\/\\]|^)((\.\.)|(src))[\/\\])"); |         static const std::regex trim_source_path(R"(.*([\/\\]|^)((\.\.)|(src))[\/\\])"); | ||||||
|         static steady_clock::time_point time_origin = steady_clock::now(); |  | ||||||
| 
 | 
 | ||||||
|         Entry entry; |         Entry entry; | ||||||
|         entry.timestamp = |         entry.timestamp = | ||||||
|  | @ -137,6 +136,7 @@ private: | ||||||
|     std::vector<std::unique_ptr<Backend>> backends; |     std::vector<std::unique_ptr<Backend>> backends; | ||||||
|     Common::MPSCQueue<Log::Entry> message_queue; |     Common::MPSCQueue<Log::Entry> message_queue; | ||||||
|     Filter filter; |     Filter filter; | ||||||
|  |     std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()}; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| void ConsoleBackend::Write(const Entry& entry) { | void ConsoleBackend::Write(const Entry& entry) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue