Skip to content

Commit f0d5f4e

Browse files
committed
---
yaml --- r: 140685 b: refs/heads/try2 c: 7652f3d h: refs/heads/master i: 140683: e43ac06 v: v3
1 parent 8737b8e commit f0d5f4e

Some content is hidden

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

78 files changed

+312
-2951
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: 3e0400fb86170baff30282edcdccff73e243fd6e
8+
refs/heads/try2: 7652f3ddb8f3c4fd281e6ec0bd8fc0d9b8ed857b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/cleanup.rs

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ struct AnnihilateStats {
127127
n_bytes_freed: uint
128128
}
129129

130-
#[cfg(stage0)]
131130
unsafe fn each_live_alloc(read_next_before: bool,
132131
f: &fn(box: *mut BoxRepr, uniq: bool) -> bool) {
133132
//! Walks the internal list of allocations
@@ -142,8 +141,8 @@ unsafe fn each_live_alloc(read_next_before: bool,
142141
let uniq =
143142
(*box).header.ref_count == managed::raw::RC_MANAGED_UNIQUE;
144143

145-
if !f(box, uniq) {
146-
return;
144+
if ! f(box, uniq) {
145+
break
147146
}
148147

149148
if read_next_before {
@@ -153,33 +152,6 @@ unsafe fn each_live_alloc(read_next_before: bool,
153152
}
154153
}
155154
}
156-
#[cfg(not(stage0))]
157-
unsafe fn each_live_alloc(read_next_before: bool,
158-
f: &fn(box: *mut BoxRepr, uniq: bool) -> bool) -> bool {
159-
//! Walks the internal list of allocations
160-
161-
use managed;
162-
163-
let task: *Task = transmute(rustrt::rust_get_task());
164-
let box = (*task).boxed_region.live_allocs;
165-
let mut box: *mut BoxRepr = transmute(copy box);
166-
while box != mut_null() {
167-
let next_before = transmute(copy (*box).header.next);
168-
let uniq =
169-
(*box).header.ref_count == managed::raw::RC_MANAGED_UNIQUE;
170-
171-
if !f(box, uniq) {
172-
return false;
173-
}
174-
175-
if read_next_before {
176-
box = next_before;
177-
} else {
178-
box = transmute(copy (*box).header.next);
179-
}
180-
}
181-
return true;
182-
}
183155

184156
#[cfg(unix)]
185157
fn debug_mem() -> bool {

branches/try2/src/libcore/container.rs

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -30,32 +30,16 @@ pub trait Map<K, V>: Mutable {
3030
fn contains_key(&self, key: &K) -> bool;
3131

3232
// Visits all keys and values
33-
#[cfg(stage0)]
3433
fn each<'a>(&'a self, f: &fn(&K, &'a V) -> bool);
35-
// Visits all keys and values
36-
#[cfg(not(stage0))]
37-
fn each<'a>(&'a self, f: &fn(&K, &'a V) -> bool) -> bool;
3834

3935
/// Visit all keys
40-
#[cfg(stage0)]
4136
fn each_key(&self, f: &fn(&K) -> bool);
42-
/// Visit all keys
43-
#[cfg(not(stage0))]
44-
fn each_key(&self, f: &fn(&K) -> bool) -> bool;
4537

4638
/// Visit all values
47-
#[cfg(stage0)]
4839
fn each_value<'a>(&'a self, f: &fn(&'a V) -> bool);
49-
/// Visit all values
50-
#[cfg(not(stage0))]
51-
fn each_value<'a>(&'a self, f: &fn(&'a V) -> bool) -> bool;
5240

5341
/// Iterate over the map and mutate the contained values
54-
#[cfg(stage0)]
5542
fn mutate_values(&mut self, f: &fn(&K, &mut V) -> bool);
56-
/// Iterate over the map and mutate the contained values
57-
#[cfg(not(stage0))]
58-
fn mutate_values(&mut self, f: &fn(&K, &mut V) -> bool) -> bool;
5943

6044
/// Return a reference to the value corresponding to the key
6145
fn find<'a>(&'a self, key: &K) -> Option<&'a V>;
@@ -81,7 +65,6 @@ pub trait Map<K, V>: Mutable {
8165
fn pop(&mut self, k: &K) -> Option<V>;
8266
}
8367

84-
#[cfg(stage0)]
8568
pub trait Set<T>: Mutable {
8669
/// Return true if the set contains a value
8770
fn contains(&self, value: &T) -> bool;
@@ -116,39 +99,3 @@ pub trait Set<T>: Mutable {
11699
/// Visit the values representing the union
117100
fn union(&self, other: &Self, f: &fn(&T) -> bool);
118101
}
119-
120-
#[cfg(not(stage0))]
121-
pub trait Set<T>: Mutable {
122-
/// Return true if the set contains a value
123-
fn contains(&self, value: &T) -> bool;
124-
125-
/// Add a value to the set. Return true if the value was not already
126-
/// present in the set.
127-
fn insert(&mut self, value: T) -> bool;
128-
129-
/// Remove a value from the set. Return true if the value was
130-
/// present in the set.
131-
fn remove(&mut self, value: &T) -> bool;
132-
133-
/// Return true if the set has no elements in common with `other`.
134-
/// This is equivalent to checking for an empty intersection.
135-
fn is_disjoint(&self, other: &Self) -> bool;
136-
137-
/// Return true if the set is a subset of another
138-
fn is_subset(&self, other: &Self) -> bool;
139-
140-
/// Return true if the set is a superset of another
141-
fn is_superset(&self, other: &Self) -> bool;
142-
143-
/// Visit the values representing the difference
144-
fn difference(&self, other: &Self, f: &fn(&T) -> bool) -> bool;
145-
146-
/// Visit the values representing the symmetric difference
147-
fn symmetric_difference(&self, other: &Self, f: &fn(&T) -> bool) -> bool;
148-
149-
/// Visit the values representing the intersection
150-
fn intersection(&self, other: &Self, f: &fn(&T) -> bool) -> bool;
151-
152-
/// Visit the values representing the union
153-
fn union(&self, other: &Self, f: &fn(&T) -> bool) -> bool;
154-
}

branches/try2/src/libcore/core

-9.02 MB
Binary file not shown.

branches/try2/src/libcore/core.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ pub mod rand;
228228
pub mod run;
229229
pub mod sys;
230230
pub mod cast;
231-
pub mod flate;
232231
pub mod repr;
233232
pub mod cleanup;
234233
pub mod reflect;

branches/try2/src/libcore/gc.rs

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ type Visitor<'self> = &'self fn(root: **Word, tydesc: *Word) -> bool;
129129

130130
// Walks the list of roots for the given safe point, and calls visitor
131131
// on each root.
132-
unsafe fn _walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) -> bool {
132+
unsafe fn walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) {
133133
let fp_bytes: *u8 = cast::transmute(fp);
134134
let sp_meta: *u32 = cast::transmute(sp.sp_meta);
135135

@@ -155,7 +155,7 @@ unsafe fn _walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) -> bool {
155155
} else {
156156
ptr::null()
157157
};
158-
if !visitor(root, tydesc) { return false; }
158+
if !visitor(root, tydesc) { return; }
159159
}
160160
sri += 1;
161161
}
@@ -168,16 +168,6 @@ unsafe fn _walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) -> bool {
168168
}
169169
rri += 1;
170170
}
171-
return true;
172-
}
173-
174-
#[cfg(stage0)]
175-
unsafe fn walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) {
176-
_walk_safe_point(fp, sp, visitor);
177-
}
178-
#[cfg(not(stage0))]
179-
unsafe fn walk_safe_point(fp: *Word, sp: SafePoint, visitor: Visitor) -> bool {
180-
_walk_safe_point(fp, sp, visitor)
181171
}
182172

183173
// Is fp contained in segment?
@@ -232,7 +222,7 @@ static need_cleanup: Memory = exchange_heap | stack;
232222

233223
// Walks stack, searching for roots of the requested type, and passes
234224
// each root to the visitor.
235-
unsafe fn _walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) -> bool {
225+
unsafe fn walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) {
236226
let mut segment = rustrt::rust_get_stack_segment();
237227
let mut last_ret: *Word = ptr::null();
238228
// To avoid collecting memory used by the GC itself, skip stack
@@ -284,14 +274,14 @@ unsafe fn _walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) -> boo
284274
// Root is a generic box.
285275
let refcount = **root;
286276
if mem | task_local_heap != 0 && refcount != -1 {
287-
if !visitor(root, tydesc) { return false; }
277+
if !visitor(root, tydesc) { return; }
288278
} else if mem | exchange_heap != 0 && refcount == -1 {
289-
if !visitor(root, tydesc) { return false; }
279+
if !visitor(root, tydesc) { return; }
290280
}
291281
} else {
292282
// Root is a non-immediate.
293283
if mem | stack != 0 {
294-
if !visitor(root, tydesc) { return false; }
284+
if !visitor(root, tydesc) { return; }
295285
}
296286
}
297287
}
@@ -300,17 +290,8 @@ unsafe fn _walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) -> boo
300290
}
301291
reached_sentinel = delay_reached_sentinel;
302292
}
303-
return true;
304293
}
305294

306-
#[cfg(stage0)]
307-
unsafe fn walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) {
308-
_walk_gc_roots(mem, sentinel, visitor);
309-
}
310-
#[cfg(not(stage0))]
311-
unsafe fn walk_gc_roots(mem: Memory, sentinel: **Word, visitor: Visitor) -> bool {
312-
_walk_gc_roots(mem, sentinel, visitor)
313-
}
314295
pub fn gc() {
315296
unsafe {
316297
// Abort when GC is disabled.

0 commit comments

Comments
 (0)