about summary refs log tree commit diff
path: root/src/libstd/sys.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-08-09 01:15:31 -0700
committerBrian Anderson <banderson@mozilla.com>2013-08-09 01:15:31 -0700
commitd39255616004ea43dfabcf33b20ed2a80cd31dff (patch)
tree9ff8806f2fe5e92546a6f769f08e798f16863f08 /src/libstd/sys.rs
parenta931e04b757a795e3867ea98c81cee731bd54ac1 (diff)
downloadrust-d39255616004ea43dfabcf33b20ed2a80cd31dff.tar.gz
rust-d39255616004ea43dfabcf33b20ed2a80cd31dff.zip
std: Fix perf of local allocations in newsched
Mostly optimizing TLS accesses to bring local heap allocation performance
closer to that of oldsched. It's not completely at parity but removing the
branches involved in supporting oldsched and optimizing pthread_get/setspecific
to instead use our dedicated TCB slot will probably make up for it.
Diffstat (limited to 'src/libstd/sys.rs')
-rw-r--r--src/libstd/sys.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys.rs b/src/libstd/sys.rs
index 9d853087123..15c096ad04f 100644
--- a/src/libstd/sys.rs
+++ b/src/libstd/sys.rs
@@ -136,7 +136,7 @@ impl FailWithCause for &'static str {
 pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
     use either::Left;
     use option::{Some, None};
-    use rt::{context, OldTaskContext, TaskContext};
+    use rt::{context, OldTaskContext, in_green_task_context};
     use rt::task::Task;
     use rt::local::Local;
     use rt::logging::Logger;
@@ -158,7 +158,7 @@ pub fn begin_unwind_(msg: *c_char, file: *c_char, line: size_t) -> ! {
 
                 // XXX: Logging doesn't work correctly in non-task context because it
                 // invokes the local heap
-                if context == TaskContext {
+                if in_green_task_context() {
                     // XXX: Logging doesn't work here - the check to call the log
                     // function never passes - so calling the log function directly.
                     do Local::borrow::<Task, ()> |task| {