_SC_NPROCESSORS_ONLN -> std:🧵:hardware_concurrency()
This commit is contained in:
		
							parent
							
								
									4f3fb34844
								
							
						
					
					
						commit
						3fab1f04a7
					
				
					 1 changed files with 3 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -2,9 +2,9 @@
 | 
			
		|||
#include "util.hh"
 | 
			
		||||
#include "archive.hh"
 | 
			
		||||
 | 
			
		||||
#include <map>
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
#include <unistd.h>
 | 
			
		||||
#include <map>
 | 
			
		||||
#include <thread>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace nix {
 | 
			
		||||
| 
						 | 
				
			
			@ -42,11 +42,7 @@ Settings::Settings()
 | 
			
		|||
    keepGoing = false;
 | 
			
		||||
    tryFallback = false;
 | 
			
		||||
    maxBuildJobs = 1;
 | 
			
		||||
    buildCores = 1;
 | 
			
		||||
#ifdef _SC_NPROCESSORS_ONLN
 | 
			
		||||
    long res = sysconf(_SC_NPROCESSORS_ONLN);
 | 
			
		||||
    if (res > 0) buildCores = res;
 | 
			
		||||
#endif
 | 
			
		||||
    buildCores = std::max(1U, std::thread::hardware_concurrency());
 | 
			
		||||
    readOnlyMode = false;
 | 
			
		||||
    thisSystem = SYSTEM;
 | 
			
		||||
    maxSilentTime = 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue