File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 80849e78a847f7834f71b36a66251ba0ea37a982
8
+ refs/heads/try2: f9a5005f52d528797d6b98a3bee73ab2d71b9aa3
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -930,6 +930,13 @@ rust_begin_unwind(uintptr_t token) {
930
930
#endif
931
931
}
932
932
933
+ extern int get_num_cpus ();
934
+
935
+ extern " C" CDECL uintptr_t
936
+ rust_get_num_cpus () {
937
+ return get_num_cpus ();
938
+ }
939
+
933
940
//
934
941
// Local Variables:
935
942
// mode: C++
Original file line number Diff line number Diff line change @@ -40,15 +40,15 @@ rust_drop_env_lock() {
40
40
}
41
41
42
42
#if defined(__WIN32__)
43
- static int
43
+ int
44
44
get_num_cpus () {
45
45
SYSTEM_INFO sysinfo;
46
46
GetSystemInfo (&sysinfo);
47
47
48
48
return (int ) sysinfo.dwNumberOfProcessors ;
49
49
}
50
50
#elif defined(__BSD__)
51
- static int
51
+ int
52
52
get_num_cpus () {
53
53
/* swiped from http://stackoverflow.com/questions/150355/
54
54
programmatically-find-the-number-of-cores-on-a-machine */
@@ -75,7 +75,7 @@ get_num_cpus() {
75
75
return numCPU;
76
76
}
77
77
#elif defined(__GNUC__)
78
- static int
78
+ int
79
79
get_num_cpus () {
80
80
return sysconf (_SC_NPROCESSORS_ONLN);
81
81
}
Original file line number Diff line number Diff line change @@ -239,3 +239,4 @@ rust_valgrind_stack_deregister
239
239
rust_take_env_lock
240
240
rust_drop_env_lock
241
241
rust_update_log_settings
242
+ rust_get_num_cpus
You can’t perform that action at this time.
0 commit comments