Skip to content

Commit 53023d5

Browse files
committed
---
yaml --- r: 108270 b: refs/heads/dist-snap c: 8d6fef6 h: refs/heads/master v: v3
1 parent b95ef1d commit 53023d5

File tree

40 files changed

+287
-455
lines changed

40 files changed

+287
-455
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 67841793522889a9cbcb93ab066ff3b744499e7d
9+
refs/heads/dist-snap: 8d6fef674dccae39f52aabfe0f77503f2d7fe464
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TOOLS := compiletest rustdoc rustc
5757

5858
DEPS_std := native:rustrt native:compiler-rt
5959
DEPS_extra := std term sync serialize getopts collections
60-
DEPS_green := std
60+
DEPS_green := std native:context_switch
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std
6363
DEPS_syntax := std extra term serialize collections

branches/dist-snap/mk/rt.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# that's per-target so you're allowed to conditionally add files based on the
3636
# target.
3737
################################################################################
38-
NATIVE_LIBS := rustrt sundown uv_support morestack miniz
38+
NATIVE_LIBS := rustrt sundown uv_support morestack miniz context_switch
3939

4040
# $(1) is the target triple
4141
define NATIVE_LIBRARIES
@@ -54,9 +54,10 @@ NATIVE_DEPS_rustrt_$(1) := rust_builtin.c \
5454
rust_android_dummy.c \
5555
rust_test_helpers.c \
5656
rust_try.ll \
57-
arch/$$(HOST_$(1))/_context.S \
5857
arch/$$(HOST_$(1))/record_sp.S
5958
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
59+
NATIVE_DEPS_context_switch_$(1) := \
60+
arch/$$(HOST_$(1))/_context.S
6061

6162
################################################################################
6263
# You shouldn't find it that necessary to edit anything below this line.

branches/dist-snap/src/libarena/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ use std::cast::{transmute, transmute_mut, transmute_mut_region};
3333
use std::cast;
3434
use std::cell::{Cell, RefCell};
3535
use std::mem;
36+
use std::cmp;
3637
use std::num;
3738
use std::kinds::marker;
3839
use std::rc::Rc;
@@ -183,7 +184,7 @@ impl Arena {
183184
// Functions for the POD part of the arena
184185
fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
185186
// Allocate a new chunk.
186-
let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
187+
let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
187188
self.chunks.set(@Cons(self.pod_head.clone(), self.chunks.get()));
188189
self.pod_head =
189190
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
@@ -223,7 +224,7 @@ impl Arena {
223224
fn alloc_nonpod_grow(&mut self, n_bytes: uint, align: uint)
224225
-> (*u8, *u8) {
225226
// Allocate a new chunk.
226-
let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
227+
let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
227228
self.chunks.set(@Cons(self.head.clone(), self.chunks.get()));
228229
self.head =
229230
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);

branches/dist-snap/src/libcollections/bitv.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use std::cmp;
1515
use std::iter::RandomAccessIterator;
1616
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
17-
use std::num;
1817
use std::ops;
1918
use std::uint;
2019
use std::vec;
@@ -846,7 +845,7 @@ impl MutableSet<uint> for BitvSet {
846845
}
847846
let nbits = self.capacity();
848847
if value >= nbits {
849-
let newsize = num::max(value, nbits * 2) / uint::BITS + 1;
848+
let newsize = cmp::max(value, nbits * 2) / uint::BITS + 1;
850849
assert!(newsize > self.bitv.storage.len());
851850
self.bitv.storage.grow(newsize, &0);
852851
}
@@ -881,7 +880,7 @@ impl BitvSet {
881880
fn commons<'a>(&'a self, other: &'a BitvSet)
882881
-> Map<'static, ((uint, &'a uint), &'a ~[uint]), (uint, uint, uint),
883882
Zip<Enumerate<vec::Items<'a, uint>>, Repeat<&'a ~[uint]>>> {
884-
let min = num::min(self.bitv.storage.len(), other.bitv.storage.len());
883+
let min = cmp::min(self.bitv.storage.len(), other.bitv.storage.len());
885884
self.bitv.storage.slice(0, min).iter().enumerate()
886885
.zip(Repeat::new(&other.bitv.storage))
887886
.map(|((i, &w), o_store)| (i * uint::BITS, w, o_store[i]))

branches/dist-snap/src/libcollections/ringbuf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! RingBuf implements the trait Deque. It should be imported with `use
1414
//! extra::container::Deque`.
1515
16-
use std::num;
16+
use std::cmp;
1717
use std::vec;
1818
use std::iter::{Rev, RandomAccessIterator};
1919

@@ -120,7 +120,7 @@ impl<T> RingBuf<T> {
120120
/// Create an empty RingBuf with space for at least `n` elements.
121121
pub fn with_capacity(n: uint) -> RingBuf<T> {
122122
RingBuf{nelts: 0, lo: 0,
123-
elts: vec::from_fn(num::max(MINIMUM_CAPACITY, n), |_| None)}
123+
elts: vec::from_fn(cmp::max(MINIMUM_CAPACITY, n), |_| None)}
124124
}
125125

126126
/// Retrieve an element in the RingBuf by index

branches/dist-snap/src/libextra/test.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ use time::precise_time_ns;
2727
use collections::TreeMap;
2828

2929
use std::clone::Clone;
30+
use std::cmp;
3031
use std::io;
3132
use std::io::File;
3233
use std::io::Writer;
@@ -1003,7 +1004,7 @@ impl MetricMap {
10031004
if delta.abs() <= noise {
10041005
LikelyNoise
10051006
} else {
1006-
let pct = delta.abs() / (vold.value).max(&f64::EPSILON) * 100.0;
1007+
let pct = delta.abs() / cmp::max(vold.value, f64::EPSILON) * 100.0;
10071008
if vold.noise < 0.0 {
10081009
// When 'noise' is negative, it means we want
10091010
// to see deltas that go up over time, and can
@@ -1126,7 +1127,7 @@ impl BenchHarness {
11261127
if self.iterations == 0 {
11271128
0
11281129
} else {
1129-
self.ns_elapsed() / self.iterations.max(&1)
1130+
self.ns_elapsed() / cmp::max(self.iterations, 1)
11301131
}
11311132
}
11321133
@@ -1149,7 +1150,7 @@ impl BenchHarness {
11491150
if self.ns_per_iter() == 0 {
11501151
n = 1_000_000;
11511152
} else {
1152-
n = 1_000_000 / self.ns_per_iter().max(&1);
1153+
n = 1_000_000 / cmp::max(self.ns_per_iter(), 1);
11531154
}
11541155
// if the first run took more than 1ms we don't want to just
11551156
// be left doing 0 iterations on every loop. The unfortunate
@@ -1215,6 +1216,7 @@ impl BenchHarness {
12151216
}
12161217
12171218
pub mod bench {
1219+
use std::cmp;
12181220
use test::{BenchHarness, BenchSamples};
12191221
12201222
pub fn benchmark(f: |&mut BenchHarness|) -> BenchSamples {
@@ -1227,7 +1229,7 @@ pub mod bench {
12271229
12281230
let ns_iter_summ = bs.auto_bench(f);
12291231
1230-
let ns_iter = (ns_iter_summ.median as u64).max(&1);
1232+
let ns_iter = cmp::max(ns_iter_summ.median as u64, 1);
12311233
let iter_s = 1_000_000_000 / ns_iter;
12321234
let mb_s = (bs.bytes * iter_s) / 1_000_000;
12331235

branches/dist-snap/src/libglob/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#[license = "MIT/ASL2"];
3030

3131
use std::cell::Cell;
32-
use std::{os, path};
32+
use std::{cmp, os, path};
3333
use std::io::fs;
3434
use std::path::is_sep;
3535

@@ -106,7 +106,7 @@ pub fn glob_with(pattern: &str, options: MatchOptions) -> Paths {
106106
}
107107

108108
let root_len = pat_root.map_or(0u, |p| p.as_vec().len());
109-
let dir_patterns = pattern.slice_from(root_len.min(&pattern.len()))
109+
let dir_patterns = pattern.slice_from(cmp::min(root_len, pattern.len()))
110110
.split_terminator(is_sep).map(|s| Pattern::new(s)).to_owned_vec();
111111

112112
let todo = list_dir_sorted(&root).move_iter().map(|x|(x,0u)).to_owned_vec();

0 commit comments

Comments
 (0)