Skip to content

Commit 90092c2

Browse files
committed
---
yaml --- r: 149187 b: refs/heads/try2 c: a06ce0c h: refs/heads/master i: 149185: 48e81c8 149183: bda1f84 v: v3
1 parent ed7bece commit 90092c2

File tree

41 files changed

+460
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+460
-290
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 22c34f3c4cddea33b916eb92f8d7286b02b865a7
8+
refs/heads/try2: a06ce0c91fac04c74a76b8fdcf89c19407af8e6a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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 native:context_switch
60+
DEPS_green := std
6161
DEPS_rustuv := std native:uv native:uv_support
6262
DEPS_native := std
6363
DEPS_syntax := std extra term serialize collections

branches/try2/mk/rt.mk

Lines changed: 2 additions & 3 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 context_switch
38+
NATIVE_LIBS := rustrt sundown uv_support morestack miniz
3939

4040
# $(1) is the target triple
4141
define NATIVE_LIBRARIES
@@ -54,10 +54,9 @@ 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 \
5758
arch/$$(HOST_$(1))/record_sp.S
5859
NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
59-
NATIVE_DEPS_context_switch_$(1) := \
60-
arch/$$(HOST_$(1))/_context.S
6160

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

branches/try2/src/compiletest/compiletest.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,14 @@ pub fn run_tests(config: &config) {
219219
mode_debug_info => {
220220
println!("arm-linux-androideabi debug-info \
221221
test uses tcp 5039 port. please reserve it");
222-
//arm-linux-androideabi debug-info test uses remote debugger
223-
//so, we test 1 task at once
224-
os::setenv("RUST_TEST_TASKS","1");
225222
}
226223
_ =>{}
227224
}
225+
226+
//arm-linux-androideabi debug-info test uses remote debugger
227+
//so, we test 1 task at once.
228+
// also trying to isolate problems with adb_run_wrapper.sh ilooping
229+
os::setenv("RUST_TEST_TASKS","1");
228230
}
229231

230232
let opts = test_opts(config);

branches/try2/src/libarena/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ 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;
3736
use std::num;
3837
use std::kinds::marker;
3938
use std::rc::Rc;
@@ -184,7 +183,7 @@ impl Arena {
184183
// Functions for the POD part of the arena
185184
fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
186185
// Allocate a new chunk.
187-
let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
186+
let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
188187
self.chunks.set(@Cons(self.pod_head.clone(), self.chunks.get()));
189188
self.pod_head =
190189
chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
@@ -224,7 +223,7 @@ impl Arena {
224223
fn alloc_nonpod_grow(&mut self, n_bytes: uint, align: uint)
225224
-> (*u8, *u8) {
226225
// Allocate a new chunk.
227-
let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
226+
let new_min_chunk_size = num::max(n_bytes, self.chunk_size());
228227
self.chunks.set(@Cons(self.head.clone(), self.chunks.get()));
229228
self.head =
230229
chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);

branches/try2/src/libcollections/bitv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use std::cmp;
1515
use std::iter::RandomAccessIterator;
1616
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
17+
use std::num;
1718
use std::ops;
1819
use std::uint;
1920
use std::vec;
@@ -845,7 +846,7 @@ impl MutableSet<uint> for BitvSet {
845846
}
846847
let nbits = self.capacity();
847848
if value >= nbits {
848-
let newsize = cmp::max(value, nbits * 2) / uint::BITS + 1;
849+
let newsize = num::max(value, nbits * 2) / uint::BITS + 1;
849850
assert!(newsize > self.bitv.storage.len());
850851
self.bitv.storage.grow(newsize, &0);
851852
}
@@ -880,7 +881,7 @@ impl BitvSet {
880881
fn commons<'a>(&'a self, other: &'a BitvSet)
881882
-> Map<'static, ((uint, &'a uint), &'a ~[uint]), (uint, uint, uint),
882883
Zip<Enumerate<vec::Items<'a, uint>>, Repeat<&'a ~[uint]>>> {
883-
let min = cmp::min(self.bitv.storage.len(), other.bitv.storage.len());
884+
let min = num::min(self.bitv.storage.len(), other.bitv.storage.len());
884885
self.bitv.storage.slice(0, min).iter().enumerate()
885886
.zip(Repeat::new(&other.bitv.storage))
886887
.map(|((i, &w), o_store)| (i * uint::BITS, w, o_store[i]))

branches/try2/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::cmp;
16+
use std::num;
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(cmp::max(MINIMUM_CAPACITY, n), |_| None)}
123+
elts: vec::from_fn(num::max(MINIMUM_CAPACITY, n), |_| None)}
124124
}
125125

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

branches/try2/src/libextra/test.rs

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

2929
use std::clone::Clone;
30-
use std::cmp;
3130
use std::io;
3231
use std::io::File;
3332
use std::io::Writer;
@@ -1004,7 +1003,7 @@ impl MetricMap {
10041003
if delta.abs() <= noise {
10051004
LikelyNoise
10061005
} else {
1007-
let pct = delta.abs() / cmp::max(vold.value, f64::EPSILON) * 100.0;
1006+
let pct = delta.abs() / (vold.value).max(&f64::EPSILON) * 100.0;
10081007
if vold.noise < 0.0 {
10091008
// When 'noise' is negative, it means we want
10101009
// to see deltas that go up over time, and can
@@ -1127,7 +1126,7 @@ impl BenchHarness {
11271126
if self.iterations == 0 {
11281127
0
11291128
} else {
1130-
self.ns_elapsed() / cmp::max(self.iterations, 1)
1129+
self.ns_elapsed() / self.iterations.max(&1)
11311130
}
11321131
}
11331132
@@ -1150,7 +1149,7 @@ impl BenchHarness {
11501149
if self.ns_per_iter() == 0 {
11511150
n = 1_000_000;
11521151
} else {
1153-
n = 1_000_000 / cmp::max(self.ns_per_iter(), 1);
1152+
n = 1_000_000 / self.ns_per_iter().max(&1);
11541153
}
11551154
// if the first run took more than 1ms we don't want to just
11561155
// be left doing 0 iterations on every loop. The unfortunate
@@ -1216,7 +1215,6 @@ impl BenchHarness {
12161215
}
12171216
12181217
pub mod bench {
1219-
use std::cmp;
12201218
use test::{BenchHarness, BenchSamples};
12211219
12221220
pub fn benchmark(f: |&mut BenchHarness|) -> BenchSamples {
@@ -1229,7 +1227,7 @@ pub mod bench {
12291227
12301228
let ns_iter_summ = bs.auto_bench(f);
12311229
1232-
let ns_iter = cmp::max(ns_iter_summ.median as u64, 1);
1230+
let ns_iter = (ns_iter_summ.median as u64).max(&1);
12331231
let iter_s = 1_000_000_000 / ns_iter;
12341232
let mb_s = (bs.bytes * iter_s) / 1_000_000;
12351233

branches/try2/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::{cmp, os, path};
32+
use std::{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(cmp::min(root_len, pattern.len()))
109+
let dir_patterns = pattern.slice_from(root_len.min(&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)