Tools/MMapsGenerator: Use system supported threads instead of hardcoded amount (#19255)
- Use unsigned int for thread count - Use std::thread::hardware_concurrency() to try estimate available threads instead of hardcoded 3 threads by default - Print thread count always regardless of using --threads switch or not
This commit is contained in:
@@ -190,9 +190,11 @@ namespace MMAP
|
||||
}
|
||||
}
|
||||
|
||||
void MapBuilder::buildAllMaps(int threads)
|
||||
void MapBuilder::buildAllMaps(unsigned int threads)
|
||||
{
|
||||
for (int i = 0; i < threads; ++i)
|
||||
printf("Using %u threads to extract mmaps\n", threads);
|
||||
|
||||
for (unsigned int i = 0; i < threads; ++i)
|
||||
{
|
||||
_workerThreads.push_back(std::thread(&MapBuilder::WorkerThread, this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user