diff options
Diffstat (limited to 'components/util')
-rw-r--r-- | components/util/memory.rs | 7 | ||||
-rw-r--r-- | components/util/task.rs | 2 | ||||
-rw-r--r-- | components/util/time.rs | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/components/util/memory.rs b/components/util/memory.rs index 0c1d1dac3b1..278a5a448fb 100644 --- a/components/util/memory.rs +++ b/components/util/memory.rs @@ -5,6 +5,7 @@ //! Memory profiling functions. use libc::{c_char,c_int,c_void,size_t}; +use std::borrow::ToOwned; use std::io::timer::sleep; #[cfg(target_os="linux")] use std::io::File; @@ -44,7 +45,7 @@ impl MemoryProfiler { Some(period) => { let period = Duration::milliseconds((period * 1000f64) as i64); let chan = chan.clone(); - spawn_named("Memory profiler timer", proc() { + spawn_named("Memory profiler timer".to_owned(), proc() { loop { sleep(period); if chan.send_opt(MemoryProfilerMsg::Print).is_err() { @@ -53,7 +54,7 @@ impl MemoryProfiler { } }); // Spawn the memory profiler. - spawn_named("Memory profiler", proc() { + spawn_named("Memory profiler".to_owned(), proc() { let memory_profiler = MemoryProfiler::new(port); memory_profiler.start(); }); @@ -61,7 +62,7 @@ impl MemoryProfiler { None => { // No-op to handle messages when the memory profiler is // inactive. - spawn_named("Memory profiler", proc() { + spawn_named("Memory profiler".to_owned(), proc() { loop { match port.recv_opt() { Err(_) | Ok(MemoryProfilerMsg::Exit) => break, diff --git a/components/util/task.rs b/components/util/task.rs index c6dc3547fb4..fbfe13078b3 100644 --- a/components/util/task.rs +++ b/components/util/task.rs @@ -9,7 +9,7 @@ use std::task::TaskBuilder; // use rtinstrument; use task_state; -pub fn spawn_named<S: IntoCow<'static, String, str>>(name: S, f: proc():Send) { +pub fn spawn_named(name: String, f: proc():Send) { let builder = task::TaskBuilder::new().named(name); builder.spawn(proc() { // rtinstrument::instrument(f); diff --git a/components/util/time.rs b/components/util/time.rs index 96d037c520a..abe35633e92 100644 --- a/components/util/time.rs +++ b/components/util/time.rs @@ -5,6 +5,7 @@ //! Timing functions. use collections::TreeMap; +use std::borrow::ToOwned; use std::comm::{Sender, channel, Receiver}; use std::f64; use std::io::timer::sleep; @@ -144,7 +145,7 @@ impl TimeProfiler { Some(period) => { let period = Duration::milliseconds((period * 1000f64) as i64); let chan = chan.clone(); - spawn_named("Time profiler timer", proc() { + spawn_named("Time profiler timer".to_owned(), proc() { loop { sleep(period); if chan.send_opt(TimeProfilerMsg::Print).is_err() { @@ -153,14 +154,14 @@ impl TimeProfiler { } }); // Spawn the time profiler. - spawn_named("Time profiler", proc() { + spawn_named("Time profiler".to_owned(), proc() { let mut profiler = TimeProfiler::new(port); profiler.start(); }); } None => { // No-op to handle messages when the time profiler is inactive. - spawn_named("Time profiler", proc() { + spawn_named("Time profiler".to_owned(), proc() { loop { match port.recv_opt() { Err(_) | Ok(TimeProfilerMsg::Exit) => break, |