mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 09:55:41 +02:00
Round the number of threads to use down to a power of 2
Since other calculations depend on this being true
This commit is contained in:
@@ -70,6 +70,9 @@ void init_cpus() {
|
|||||||
CPUS = 1;
|
CPUS = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Round down to a power of 2
|
||||||
|
CPUS = 1 << (int) (log(CPUS) / log(2));
|
||||||
|
|
||||||
TEMP_FILES = 64;
|
TEMP_FILES = 64;
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
if (getrlimit(RLIMIT_NOFILE, &rl) != 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user