// Windows tends to dislike being overloaded with threads.
#[cfg(windows)]
- static sched_overcommit : uint = 1;
+ static SCHED_OVERCOMMIT : uint = 1;
#[cfg(unix)]
- static sched_overcommit : uint = 4u;
+ static SCHED_OVERCOMMIT : uint = 4u;
fn get_concurrency() -> uint {
- unsafe {
- let threads = rustrt::rust_sched_threads() as uint;
- if threads == 1 { 1 }
- else { threads * SCHED_OVERCOMMIT }
- }
+ use std::rt;
+ let threads = rt::util::default_sched_threads();
+ if threads == 1 { 1 }
- else { threads * sched_overcommit }
++ else { threads * SCHED_OVERCOMMIT }
}
#[allow(non_implicitly_copyable_typarams)]
#[cfg(not(stage0), not(test))]
#[lang="exchange_malloc"]
#[inline]
- pub unsafe fn exchange_malloc_(align: u32, size: uintptr_t) -> *c_char {
- exchange_malloc(align, size)
-pub unsafe fn exchange_malloc(_align: u32, size: uintptr_t) -> *c_char {
++pub unsafe fn exchange_malloc(align: u32, size: uintptr_t) -> *c_char {
+ malloc_raw(size as uint) as *c_char
}
- #[cfg(not(stage0))]
+ #[cfg(not(test))]
+ #[lang="vector_exchange_malloc"]
#[inline]
- pub unsafe fn exchange_malloc(align: u32, size: uintptr_t) -> *c_char {
+ pub unsafe fn vector_exchange_malloc(align: u32, size: uintptr_t) -> *c_char {
let total_size = get_box_size(size as uint, align as uint);
malloc_raw(total_size as uint) as *c_char
}
use cast;
use container::{Container, Mutable};
use cmp;
- use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
+ use cmp::{Eq, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
use clone::Clone;
use iterator::{FromIterator, Iterator, IteratorUtil};
- use iter::FromIter;
use kinds::Copy;
-use libc;
use libc::c_void;
use num::Zero;
- use ops::Add;
use option::{None, Option, Some};
use ptr::to_unsafe_ptr;
use ptr;