Skip to content

Commit 9b2a8e1

Browse files
committed
Revert "std: adjust requested stack size for thread-local storage."
This reverts commit f1b5f59. Using a private function of a library is a bad idea: several people (on Linux) were meeting with linking errors because of it (different/older versions of glibc).
1 parent 4bca7fd commit 9b2a8e1

File tree

2 files changed

+1
-41
lines changed

2 files changed

+1
-41
lines changed

Diff for: src/libstd/rt/thread.rs

+1-19
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,8 @@ mod imp {
202202
let mut native: libc::pthread_t = intrinsics::uninit();
203203
let mut attr: libc::pthread_attr_t = intrinsics::uninit();
204204
assert_eq!(pthread_attr_init(&mut attr), 0);
205-
206-
let min_stack = get_min_stack(&attr);
207205
assert_eq!(pthread_attr_setstacksize(&mut attr,
208-
min_stack + stack as libc::size_t), 0);
206+
stack as libc::size_t), 0);
209207
assert_eq!(pthread_attr_setdetachstate(&mut attr,
210208
PTHREAD_CREATE_JOINABLE), 0);
211209

@@ -230,18 +228,6 @@ mod imp {
230228
#[cfg(not(target_os = "macos"), not(target_os = "android"))]
231229
pub unsafe fn yield_now() { assert_eq!(pthread_yield(), 0); }
232230

233-
// Issue #6233. On some platforms, putting a lot of data in
234-
// thread-local storage means we need to set the stack-size to be
235-
// larger.
236-
#[cfg(target_os = "linux")]
237-
unsafe fn get_min_stack(attr: &libc::pthread_attr_t) -> libc::size_t {
238-
__pthread_get_minstack(attr)
239-
}
240-
#[cfg(not(target_os = "linux"))]
241-
unsafe fn get_min_stack(_: &libc::pthread_attr_t) -> libc::size_t {
242-
0
243-
}
244-
245231
extern {
246232
fn pthread_create(native: *mut libc::pthread_t,
247233
attr: *libc::pthread_attr_t,
@@ -261,10 +247,6 @@ mod imp {
261247
fn sched_yield() -> libc::c_int;
262248
#[cfg(not(target_os = "macos"), not(target_os = "android"))]
263249
fn pthread_yield() -> libc::c_int;
264-
265-
// This appears to be glibc specific
266-
#[cfg(target_os = "linux")]
267-
fn __pthread_get_minstack(attr: *libc::pthread_attr_t) -> libc::size_t;
268250
}
269251
}
270252

Diff for: src/test/run-pass/large-thread-local-data.rs

-22
This file was deleted.

0 commit comments

Comments
 (0)