Skip to content

Commit a65f887

Browse files
committed
---
yaml --- r: 152874 b: refs/heads/try2 c: dfef422 h: refs/heads/master v: v3
1 parent 1dd640c commit a65f887

File tree

17 files changed

+131
-386
lines changed

17 files changed

+131
-386
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: c0f231072b8f9d5f1fe346e952fdc2e3404e0b94
8+
refs/heads/try2: dfef4220242227fb210e58eedc91bcc74de8921f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libgreen/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub fn start(argc: int, argv: **u8,
299299
let mut ret = None;
300300
simple::task().run(|| {
301301
ret = Some(run(event_loop_factory, main.take_unwrap()));
302-
}).destroy();
302+
});
303303
// unsafe is ok b/c we're sure that the runtime is gone
304304
unsafe { rt::cleanup() }
305305
ret.unwrap()

branches/try2/src/libgreen/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ extern fn bootstrap_green_task(task: uint, code: *(), env: *()) -> ! {
110110
// requested. This is the "try/catch" block for this green task and
111111
// is the wrapper for *all* code run in the task.
112112
let mut start = Some(start);
113-
let task = task.swap().run(|| start.take_unwrap()()).destroy();
113+
let task = task.swap().run(|| start.take_unwrap()());
114114

115115
// Once the function has exited, it's time to run the termination
116116
// routine. This means we need to context switch one more time but
@@ -120,7 +120,7 @@ extern fn bootstrap_green_task(task: uint, code: *(), env: *()) -> ! {
120120
// this we could add a `terminate` function to the `Runtime` trait
121121
// in libstd, but that seems less appropriate since the coversion
122122
// method exists.
123-
GreenTask::convert(task).terminate();
123+
GreenTask::convert(task).terminate()
124124
}
125125

126126
impl GreenTask {

branches/try2/src/libnative/io/process.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,6 @@ fn spawn_process_os(cfg: ProcessConfig,
533533

534534
let dirp = cfg.cwd.map(|c| c.with_ref(|p| p)).unwrap_or(ptr::null());
535535

536-
let cfg = unsafe {
537-
mem::transmute::<ProcessConfig,ProcessConfig<'static>>(cfg)
538-
};
539-
540536
with_envp(cfg.env, proc(envp) {
541537
with_argv(cfg.program, cfg.args, proc(argv) unsafe {
542538
let (mut input, mut output) = try!(pipe());

branches/try2/src/libnative/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,13 @@ pub fn start(argc: int, argv: **u8, main: proc()) -> int {
134134
let mut main = Some(main);
135135
let mut task = task::new((my_stack_bottom, my_stack_top));
136136
task.name = Some(str::Slice("<main>"));
137-
drop(task.run(|| {
137+
let t = task.run(|| {
138138
unsafe {
139139
rt::stack::record_stack_bounds(my_stack_bottom, my_stack_top);
140140
}
141141
exit_code = Some(run(main.take_unwrap()));
142-
}).destroy());
142+
});
143+
drop(t);
143144
unsafe { rt::cleanup(); }
144145
// If the exit code wasn't set, then the task block must have failed.
145146
return exit_code.unwrap_or(rt::DEFAULT_ERROR_CODE);

branches/try2/src/libnative/task.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ pub fn spawn_opts(opts: TaskOpts, f: proc():Send) {
9292
let mut f = Some(f);
9393
let mut task = task;
9494
task.put_runtime(ops);
95-
drop(task.run(|| { f.take_unwrap()() }).destroy());
95+
let t = task.run(|| { f.take_unwrap()() });
96+
drop(t);
9697
bookkeeping::decrement();
9798
})
9899
}

branches/try2/src/librustc/middle/kind.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,8 @@ fn with_appropriate_checker(cx: &Context,
198198
let fty = ty::node_id_to_type(cx.tcx, id);
199199
match ty::get(fty).sty {
200200
ty::ty_closure(box ty::ClosureTy {
201-
store: ty::UniqTraitStore,
202-
bounds: mut bounds, ..
203-
}) => {
204-
// Procs can't close over non-static references!
205-
bounds.add(ty::BoundStatic);
206-
207-
b(|cx, fv| check_for_uniq(cx, fv, bounds))
208-
}
201+
store: ty::UniqTraitStore, bounds, ..
202+
}) => b(|cx, fv| check_for_uniq(cx, fv, bounds)),
209203

210204
ty::ty_closure(box ty::ClosureTy {
211205
store: ty::RegionTraitStore(region, _), bounds, ..

branches/try2/src/librustrt/local_heap.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,7 @@ impl LocalHeap {
110110
self.memory_region.free(alloc);
111111
}
112112

113-
/// Immortalize all pending allocations, forcing them to live forever.
114-
///
115-
/// This function will freeze all allocations to prevent all pending
116-
/// allocations from being deallocated. This is used in preparation for when
117-
/// a task is about to destroy TLD.
118-
pub unsafe fn immortalize(&mut self) {
113+
pub unsafe fn annihilate(&mut self) {
119114
let mut n_total_boxes = 0u;
120115

121116
// Pass 1: Make all boxes immortal.
@@ -127,17 +122,6 @@ impl LocalHeap {
127122
(*alloc).ref_count = RC_IMMORTAL;
128123
});
129124

130-
if debug_mem() {
131-
// We do logging here w/o allocation.
132-
rterrln!("total boxes annihilated: {}", n_total_boxes);
133-
}
134-
}
135-
136-
/// Continues deallocation of the all pending allocations in this arena.
137-
///
138-
/// This is invoked from the destructor, and requires that `immortalize` has
139-
/// been called previously.
140-
unsafe fn annihilate(&mut self) {
141125
// Pass 2: Drop all boxes.
142126
//
143127
// In this pass, unique-managed boxes may get freed, but not
@@ -158,6 +142,11 @@ impl LocalHeap {
158142
self.each_live_alloc(true, |me, alloc| {
159143
me.free(alloc);
160144
});
145+
146+
if debug_mem() {
147+
// We do logging here w/o allocation.
148+
rterrln!("total boxes annihilated: {}", n_total_boxes);
149+
}
161150
}
162151

163152
unsafe fn each_live_alloc(&mut self, read_next_before: bool,
@@ -181,7 +170,6 @@ impl LocalHeap {
181170

182171
impl Drop for LocalHeap {
183172
fn drop(&mut self) {
184-
unsafe { self.annihilate() }
185173
assert!(self.live_allocs.is_null());
186174
}
187175
}

0 commit comments

Comments
 (0)