mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)
This commit is contained in:
parent
8a7eefefd5
commit
a640a7c5c3
74 changed files with 459 additions and 449 deletions
|
@ -18,7 +18,6 @@ path = "../../support/rust-task_info"
|
|||
|
||||
[dependencies.string_cache]
|
||||
git = "https://github.com/servo/string-cache"
|
||||
branch = "pre-rustup"
|
||||
|
||||
[dependencies.url]
|
||||
git = "https://github.com/servo/rust-url"
|
||||
git = "https://github.com/servo/rust-url"
|
||||
|
|
|
@ -25,7 +25,7 @@ extern crate serialize;
|
|||
extern crate sync;
|
||||
#[cfg(target_os="macos")]
|
||||
extern crate task_info;
|
||||
extern crate std_time = "time";
|
||||
extern crate "time" as std_time;
|
||||
extern crate string_cache;
|
||||
extern crate url;
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ use std::io::File;
|
|||
use std::mem::size_of;
|
||||
#[cfg(target_os="linux")]
|
||||
use std::os::page_size;
|
||||
use std::ptr::mut_null;
|
||||
use std::ptr::null_mut;
|
||||
use std::time::duration::Duration;
|
||||
use task::spawn_named;
|
||||
#[cfg(target_os="macos")]
|
||||
use task_info::task_basic_info::{virtual_size,resident_size};
|
||||
|
@ -41,7 +42,7 @@ impl MemoryProfiler {
|
|||
let (chan, port) = channel();
|
||||
match period {
|
||||
Some(period) => {
|
||||
let period = (period * 1000f64) as u64;
|
||||
let period = Duration::milliseconds((period * 1000f64) as i64);
|
||||
let chan = chan.clone();
|
||||
spawn_named("Memory profiler timer", proc() {
|
||||
loop {
|
||||
|
@ -154,7 +155,7 @@ fn get_jemalloc_stat(name: &'static str) -> Option<u64> {
|
|||
let mut oldlen = size_of::<size_t>() as size_t;
|
||||
let rv: c_int;
|
||||
unsafe {
|
||||
rv = je_mallctl(c_name.unwrap(), oldp, &mut oldlen, mut_null(), 0);
|
||||
rv = je_mallctl(c_name.unwrap(), oldp, &mut oldlen, null_mut(), 0);
|
||||
}
|
||||
if rv == 0 { Some(old as u64) } else { None }
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
//! Small vectors in various sizes. These store a certain number of elements inline and fall back
|
||||
//! to the heap for larger allocations.
|
||||
|
||||
use i = std::mem::init;
|
||||
use std::mem::init as i;
|
||||
use std::cmp;
|
||||
use std::intrinsics;
|
||||
use std::kinds::marker::ContravariantLifetime;
|
||||
|
@ -57,7 +57,7 @@ trait SmallVecPrivate<T> {
|
|||
unsafe fn set_ptr(&mut self, new_ptr: *mut T);
|
||||
}
|
||||
|
||||
pub trait SmallVec<T> : SmallVecPrivate<T> {
|
||||
pub trait SmallVec<T> : SmallVecPrivate<T> where T: 'static {
|
||||
fn inline_size(&self) -> uint;
|
||||
fn len(&self) -> uint;
|
||||
fn cap(&self) -> uint;
|
||||
|
@ -300,7 +300,7 @@ pub struct SmallVecMoveIterator<'a,T> {
|
|||
lifetime: ContravariantLifetime<'a>,
|
||||
}
|
||||
|
||||
impl<'a,T> Iterator<T> for SmallVecMoveIterator<'a,T> {
|
||||
impl<'a, T: 'static> Iterator<T> for SmallVecMoveIterator<'a,T> {
|
||||
#[inline]
|
||||
fn next(&mut self) -> Option<T> {
|
||||
unsafe {
|
||||
|
@ -317,7 +317,7 @@ impl<'a,T> Iterator<T> for SmallVecMoveIterator<'a,T> {
|
|||
}
|
||||
|
||||
#[unsafe_destructor]
|
||||
impl<'a,T> Drop for SmallVecMoveIterator<'a,T> {
|
||||
impl<'a, T: 'static> Drop for SmallVecMoveIterator<'a,T> {
|
||||
fn drop(&mut self) {
|
||||
// Destroy the remaining elements.
|
||||
for _ in *self {}
|
||||
|
@ -350,7 +350,7 @@ macro_rules! def_small_vector(
|
|||
data: [T, ..$size],
|
||||
}
|
||||
|
||||
impl<T> SmallVecPrivate<T> for $name<T> {
|
||||
impl<T: 'static> SmallVecPrivate<T> for $name<T> {
|
||||
unsafe fn set_len(&mut self, new_len: uint) {
|
||||
self.len = new_len
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ macro_rules! def_small_vector(
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> SmallVec<T> for $name<T> {
|
||||
impl<T: 'static> SmallVec<T> for $name<T> {
|
||||
fn inline_size(&self) -> uint {
|
||||
$size
|
||||
}
|
||||
|
@ -388,7 +388,7 @@ macro_rules! def_small_vector(
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> VecLike<T> for $name<T> {
|
||||
impl<T: 'static> VecLike<T> for $name<T> {
|
||||
#[inline]
|
||||
fn vec_len(&self) -> uint {
|
||||
self.len()
|
||||
|
@ -405,7 +405,7 @@ macro_rules! def_small_vector(
|
|||
}
|
||||
}
|
||||
|
||||
impl<T> $name<T> {
|
||||
impl<T: 'static> $name<T> {
|
||||
#[inline]
|
||||
pub fn new() -> $name<T> {
|
||||
unsafe {
|
||||
|
@ -432,7 +432,7 @@ def_small_vector!(SmallVec32, 32)
|
|||
macro_rules! def_small_vector_drop_impl(
|
||||
($name:ident, $size:expr) => (
|
||||
#[unsafe_destructor]
|
||||
impl<T> Drop for $name<T> {
|
||||
impl<T: 'static> Drop for $name<T> {
|
||||
fn drop(&mut self) {
|
||||
if !self.spilled() {
|
||||
return
|
||||
|
@ -467,7 +467,7 @@ def_small_vector_drop_impl!(SmallVec32, 32)
|
|||
|
||||
macro_rules! def_small_vector_clone_impl(
|
||||
($name:ident) => (
|
||||
impl<T:Clone> Clone for $name<T> {
|
||||
impl<T:Clone+'static> Clone for $name<T> {
|
||||
fn clone(&self) -> $name<T> {
|
||||
let mut new_vector = $name::new();
|
||||
for element in self.iter() {
|
||||
|
|
|
@ -10,6 +10,7 @@ use std::comm::{Sender, channel, Receiver};
|
|||
use std::f64;
|
||||
use std::iter::AdditiveIterator;
|
||||
use std::io::timer::sleep;
|
||||
use std::time::duration::Duration;
|
||||
use task::{spawn_named};
|
||||
use url::Url;
|
||||
|
||||
|
@ -127,7 +128,7 @@ impl TimeProfiler {
|
|||
let (chan, port) = channel();
|
||||
match period {
|
||||
Some(period) => {
|
||||
let period = (period * 1000f64) as u64;
|
||||
let period = Duration::milliseconds((period * 1000f64) as i64);
|
||||
let chan = chan.clone();
|
||||
spawn_named("Time profiler timer", proc() {
|
||||
loop {
|
||||
|
|
|
@ -156,13 +156,13 @@ impl<QueueData: Send, WorkData: Send> WorkerThread<QueueData, WorkData> {
|
|||
}
|
||||
|
||||
/// A handle to the work queue that individual work units have.
|
||||
pub struct WorkerProxy<'a, QueueData, WorkData> {
|
||||
pub struct WorkerProxy<'a, QueueData: 'a, WorkData: 'a> {
|
||||
worker: &'a mut Worker<WorkUnit<QueueData, WorkData>>,
|
||||
ref_count: *mut AtomicUint,
|
||||
queue_data: *const QueueData,
|
||||
}
|
||||
|
||||
impl<'a, QueueData, WorkData: Send> WorkerProxy<'a, QueueData, WorkData> {
|
||||
impl<'a, QueueData: 'static, WorkData: Send> WorkerProxy<'a, QueueData, WorkData> {
|
||||
/// Enqueues a block into the work queue.
|
||||
#[inline]
|
||||
pub fn push(&mut self, work_unit: WorkUnit<QueueData, WorkData>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue