-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into tile-join-sqlite
- Loading branch information
Showing
11 changed files
with
136 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include "platform.hpp" | ||
#include <cstdlib> | ||
#include <cstdio> | ||
#include <unistd.h> | ||
#include <sys/resource.h> | ||
|
||
#if defined(__APPLE__) || defined(__FreeBSD__) | ||
#include <sys/types.h> | ||
#include <sys/sysctl.h> | ||
#include <sys/param.h> | ||
#include <sys/mount.h> | ||
#endif | ||
|
||
#include "errors.hpp" | ||
|
||
long get_num_avail_cpus() { | ||
return sysconf(_SC_NPROCESSORS_ONLN); | ||
} | ||
|
||
long get_page_size() { | ||
return sysconf(_SC_PAGESIZE); | ||
} | ||
|
||
size_t calc_memsize() { | ||
size_t mem; | ||
|
||
#ifdef __APPLE__ | ||
int64_t hw_memsize; | ||
size_t len = sizeof(int64_t); | ||
if (sysctlbyname("hw.memsize", &hw_memsize, &len, NULL, 0) < 0) { | ||
perror("sysctl hw.memsize"); | ||
exit(EXIT_MEMORY); | ||
} | ||
mem = hw_memsize; | ||
#else | ||
long long pagesize = sysconf(_SC_PAGESIZE); | ||
long long pages = sysconf(_SC_PHYS_PAGES); | ||
if (pages < 0 || pagesize < 0) { | ||
perror("sysconf _SC_PAGESIZE or _SC_PHYS_PAGES"); | ||
exit(EXIT_MEMORY); | ||
} | ||
|
||
mem = (long long) pages * pagesize; | ||
#endif | ||
|
||
return mem; | ||
} | ||
|
||
size_t get_max_open_files() { | ||
struct rlimit rl; | ||
if (getrlimit(RLIMIT_NOFILE, &rl) != 0) { | ||
perror("getrlimit"); | ||
exit(EXIT_PTHREAD); | ||
} | ||
return rl.rlim_cur; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef PLATFORM_HPP | ||
#define PLATFORM_HPP | ||
|
||
#include <cstddef> | ||
|
||
long get_num_avail_cpus(); | ||
|
||
long get_page_size(); | ||
|
||
size_t calc_memsize(); | ||
|
||
size_t get_max_open_files(); | ||
|
||
constexpr const char *get_null_device() { | ||
return "/dev/null"; | ||
} | ||
|
||
#endif // PLATFORM_HPP |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"coordinates":[[[-73.9722549,40.7904659],[-73.9755817,40.7674848],[-73.938783,40.767022],[-73.9457082,40.7791562],[-73.9628855,40.7760201],[-73.9629534,40.7914425],[-73.9722549,40.7904659]]],"crs":{"properties":{"name":"EPSG:4326"},"type":"name"},"type":"Polygon"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#ifndef VERSION_HPP | ||
#define VERSION_HPP | ||
|
||
#define VERSION "v2.72.0" | ||
#define VERSION "v2.73.0" | ||
|
||
#endif |