Skip to content

Commit 36bf5b9

Browse files
committed
Register new snapshots
1 parent 58eeb07 commit 36bf5b9

11 files changed

+11
-202
lines changed

Makefile.in

+2-6
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ ifdef TRACE
125125
CFG_RUSTC_FLAGS += -Z trace
126126
endif
127127
ifdef CFG_DISABLE_RPATH
128-
# NOTE: make this CFG_RUSTC_FLAGS after stage0 snapshot
129-
RUSTFLAGS_STAGE1 += -C no-rpath
130-
RUSTFLAGS_STAGE2 += -C no-rpath
131-
RUSTFLAGS_STAGE3 += -C no-rpath
128+
CFG_RUSTC_FLAGS += -C no-rpath
132129
endif
133130

134131
# The executables crated during this compilation process have no need to include
@@ -140,8 +137,7 @@ endif
140137
# snapshot will be generated with a statically linked rustc so we only have to
141138
# worry about the distribution of one file (with its native dynamic
142139
# dependencies)
143-
#
144-
# NOTE: after a snapshot (stage0), put this on stage0 as well
140+
RUSTFLAGS_STAGE0 += -C prefer-dynamic
145141
RUSTFLAGS_STAGE1 += -C prefer-dynamic
146142

147143
# platform-specific auto-configuration

src/libextra/lib.rs

-10
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,10 @@ Rust extras are part of the standard Rust distribution.
3535
#[deny(missing_doc)];
3636

3737
extern mod sync;
38-
#[cfg(not(stage0))]
3938
extern mod serialize;
4039

4140
extern mod collections;
4241

43-
#[cfg(stage0)]
44-
pub mod serialize {
45-
#[allow(missing_doc)];
46-
// Temp re-export until after a snapshot
47-
extern mod serialize = "serialize";
48-
pub use self::serialize::{Encoder, Decoder, Encodable, Decodable,
49-
EncoderHelpers, DecoderHelpers};
50-
}
51-
5242
// Utility modules
5343

5444
pub mod c_vec;

src/libstd/cleanup.rs

-47
Original file line numberDiff line numberDiff line change
@@ -57,53 +57,6 @@ fn debug_mem() -> bool {
5757
}
5858

5959
/// Destroys all managed memory (i.e. @ boxes) held by the current task.
60-
#[cfg(stage0)]
61-
pub unsafe fn annihilate() {
62-
use rt::local_heap::local_free;
63-
64-
let mut n_total_boxes = 0u;
65-
66-
// Pass 1: Make all boxes immortal.
67-
//
68-
// In this pass, nothing gets freed, so it does not matter whether
69-
// we read the next field before or after the callback.
70-
each_live_alloc(true, |alloc| {
71-
n_total_boxes += 1;
72-
(*alloc).ref_count = RC_IMMORTAL;
73-
true
74-
});
75-
76-
// Pass 2: Drop all boxes.
77-
//
78-
// In this pass, unique-managed boxes may get freed, but not
79-
// managed boxes, so we must read the `next` field *after* the
80-
// callback, as the original value may have been freed.
81-
each_live_alloc(false, |alloc| {
82-
let tydesc = (*alloc).type_desc;
83-
let data = &(*alloc).data as *();
84-
((*tydesc).drop_glue)(data as *i8);
85-
true
86-
});
87-
88-
// Pass 3: Free all boxes.
89-
//
90-
// In this pass, managed boxes may get freed (but not
91-
// unique-managed boxes, though I think that none of those are
92-
// left), so we must read the `next` field before, since it will
93-
// not be valid after.
94-
each_live_alloc(true, |alloc| {
95-
local_free(alloc as *u8);
96-
true
97-
});
98-
99-
if debug_mem() {
100-
// We do logging here w/o allocation.
101-
debug!("total boxes annihilated: {}", n_total_boxes);
102-
}
103-
}
104-
105-
/// Destroys all managed memory (i.e. @ boxes) held by the current task.
106-
#[cfg(not(stage0))]
10760
pub unsafe fn annihilate() {
10861
use rt::local_heap::local_free;
10962

src/libstd/reflect.rs

-7
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,4 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
441441
self.align_to::<&'static u8>();
442442
true
443443
}
444-
445-
// NOTE Remove after next snapshot.
446-
#[cfg(stage0)]
447-
fn visit_type(&mut self) -> bool {
448-
if ! self.inner.visit_type() { return false; }
449-
true
450-
}
451444
}

src/libstd/repr.rs

-4
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,6 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
601601

602602
fn visit_param(&mut self, _i: uint) -> bool { true }
603603
fn visit_self(&mut self) -> bool { true }
604-
605-
// NOTE Remove after next snapshot.
606-
#[cfg(stage0)]
607-
fn visit_type(&mut self) -> bool { true }
608604
}
609605

610606
pub fn write_repr<T>(writer: &mut io::Writer, object: &T) -> io::IoResult<()> {

src/libstd/rt/global_heap.rs

+1-29
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
use libc::{c_void, size_t, free, malloc, realloc};
1212
use ptr::{RawPtr, mut_null};
13-
#[cfg(stage0)]
14-
use unstable::intrinsics::TyDesc;
1513
use unstable::intrinsics::abort;
1614
use unstable::raw;
1715
use mem::size_of;
@@ -75,40 +73,14 @@ pub unsafe fn exchange_malloc(size: uint) -> *u8 {
7573
}
7674

7775
// FIXME: #7496
78-
#[cfg(not(test), stage0)]
79-
#[lang="closure_exchange_malloc"]
80-
#[inline]
81-
pub unsafe fn closure_exchange_malloc_(td: *u8, size: uint) -> *u8 {
82-
closure_exchange_malloc(td, size)
83-
}
84-
85-
// FIXME: #7496
86-
#[cfg(not(test), not(stage0))]
76+
#[cfg(not(test))]
8777
#[lang="closure_exchange_malloc"]
8878
#[inline]
8979
pub unsafe fn closure_exchange_malloc_(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 {
9080
closure_exchange_malloc(drop_glue, size, align)
9181
}
9282

9383
#[inline]
94-
#[cfg(stage0)]
95-
pub unsafe fn closure_exchange_malloc(td: *u8, size: uint) -> *u8 {
96-
let td = td as *TyDesc;
97-
let size = size;
98-
99-
assert!(td.is_not_null());
100-
101-
let total_size = get_box_size(size, (*td).align);
102-
let p = malloc_raw(total_size);
103-
104-
let alloc = p as *mut raw::Box<()>;
105-
(*alloc).type_desc = td;
106-
107-
alloc as *u8
108-
}
109-
110-
#[inline]
111-
#[cfg(not(stage0))]
11284
pub unsafe fn closure_exchange_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 {
11385
let total_size = get_box_size(size, align);
11486
let p = malloc_raw(total_size);

src/libstd/rt/local_heap.rs

-74
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ use rt::env;
2121
use rt::global_heap;
2222
use rt::local::Local;
2323
use rt::task::Task;
24-
#[cfg(stage0)]
25-
use unstable::intrinsics::TyDesc;
2624
use unstable::raw;
2725
use vec::ImmutableVector;
2826

@@ -61,29 +59,6 @@ impl LocalHeap {
6159
}
6260

6361
#[inline]
64-
#[cfg(stage0)]
65-
pub fn alloc(&mut self, td: *TyDesc, size: uint) -> *mut Box {
66-
let total_size = global_heap::get_box_size(size, unsafe { (*td).align });
67-
let alloc = self.memory_region.malloc(total_size);
68-
{
69-
// Make sure that we can't use `mybox` outside of this scope
70-
let mybox: &mut Box = unsafe { cast::transmute(alloc) };
71-
// Clear out this box, and move it to the front of the live
72-
// allocations list
73-
mybox.type_desc = td;
74-
mybox.ref_count = 1;
75-
mybox.prev = ptr::mut_null();
76-
mybox.next = self.live_allocs;
77-
if !self.live_allocs.is_null() {
78-
unsafe { (*self.live_allocs).prev = alloc; }
79-
}
80-
self.live_allocs = alloc;
81-
}
82-
return alloc;
83-
}
84-
85-
#[inline]
86-
#[cfg(not(stage0))]
8762
pub fn alloc(&mut self, drop_glue: fn(*mut u8), size: uint, align: uint) -> *mut Box {
8863
let total_size = global_heap::get_box_size(size, align);
8964
let alloc = self.memory_region.malloc(total_size);
@@ -126,41 +101,6 @@ impl LocalHeap {
126101
}
127102

128103
#[inline]
129-
#[cfg(stage0)]
130-
pub fn free(&mut self, alloc: *mut Box) {
131-
{
132-
// Make sure that we can't use `mybox` outside of this scope
133-
let mybox: &mut Box = unsafe { cast::transmute(alloc) };
134-
assert!(!mybox.type_desc.is_null());
135-
136-
// Unlink it from the linked list
137-
if !mybox.prev.is_null() {
138-
unsafe { (*mybox.prev).next = mybox.next; }
139-
}
140-
if !mybox.next.is_null() {
141-
unsafe { (*mybox.next).prev = mybox.prev; }
142-
}
143-
if self.live_allocs == alloc {
144-
self.live_allocs = mybox.next;
145-
}
146-
147-
// Destroy the box memory-wise
148-
if self.poison_on_free {
149-
unsafe {
150-
let ptr: *mut u8 = cast::transmute(&mybox.data);
151-
ptr::set_memory(ptr, 0xab, (*mybox.type_desc).size);
152-
}
153-
}
154-
mybox.prev = ptr::mut_null();
155-
mybox.next = ptr::mut_null();
156-
mybox.type_desc = ptr::null();
157-
}
158-
159-
self.memory_region.free(alloc);
160-
}
161-
162-
#[inline]
163-
#[cfg(not(stage0))]
164104
pub fn free(&mut self, alloc: *mut Box) {
165105
{
166106
// Make sure that we can't use `mybox` outside of this scope
@@ -339,20 +279,6 @@ impl Drop for MemoryRegion {
339279
}
340280

341281
#[inline]
342-
#[cfg(stage0)]
343-
pub unsafe fn local_malloc(td: *u8, size: uint) -> *u8 {
344-
// FIXME: Unsafe borrow for speed. Lame.
345-
let task: Option<*mut Task> = Local::try_unsafe_borrow();
346-
match task {
347-
Some(task) => {
348-
(*task).heap.alloc(td as *TyDesc, size) as *u8
349-
}
350-
None => rtabort!("local malloc outside of task")
351-
}
352-
}
353-
354-
#[inline]
355-
#[cfg(not(stage0))]
356282
pub unsafe fn local_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 {
357283
// FIXME: Unsafe borrow for speed. Lame.
358284
let task: Option<*mut Task> = Local::try_unsafe_borrow();

src/libstd/unstable/intrinsics.rs

-4
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ pub trait TyVisitor {
160160
fn visit_trait(&mut self, name: &str) -> bool;
161161
fn visit_param(&mut self, i: uint) -> bool;
162162
fn visit_self(&mut self) -> bool;
163-
164-
// NOTE Remove after next snapshot.
165-
#[cfg(stage0)]
166-
fn visit_type(&mut self) -> bool;
167163
}
168164

169165
extern "rust-intrinsic" {

src/libstd/unstable/lang.rs

-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ pub fn fail_bounds_check(file: *u8, line: uint, index: uint, len: uint) -> ! {
2727
}
2828

2929
#[lang="malloc"]
30-
#[cfg(stage0)]
31-
#[inline]
32-
pub unsafe fn local_malloc(td: *u8, size: uint) -> *u8 {
33-
::rt::local_heap::local_malloc(td, size)
34-
}
35-
36-
#[lang="malloc"]
37-
#[cfg(not(stage0))]
3830
#[inline]
3931
pub unsafe fn local_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 {
4032
::rt::local_heap::local_malloc(drop_glue, size, align)

src/libstd/unstable/raw.rs

-13
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,8 @@
99
// except according to those terms.
1010

1111
use cast;
12-
#[cfg(stage0)]
13-
use unstable::intrinsics::TyDesc;
1412

1513
/// The representation of a Rust managed box
16-
#[cfg(stage0)]
17-
pub struct Box<T> {
18-
ref_count: uint,
19-
type_desc: *TyDesc,
20-
prev: *mut Box<T>,
21-
next: *mut Box<T>,
22-
data: T
23-
}
24-
25-
/// The representation of a Rust managed box
26-
#[cfg(not(stage0))]
2714
pub struct Box<T> {
2815
ref_count: uint,
2916
drop_glue: fn(ptr: *mut u8),

src/snapshots.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
S 2014-02-12 c62f6ce
2+
freebsd-x86_64 737a423c5f803119ff5a692eac432fa9d0c595a8
3+
linux-i386 a7e90e27e8b6a3fa79ddc15f0ed217ccbade875d
4+
linux-x86_64 8f5fdf9f07b2afbc55d8d8c06c60aeb532b5ea83
5+
macos-i386 57bb225f45bc57fef4c34552a2d5814ab4913087
6+
macos-x86_64 d37b62478aa1c1dd1babb19d1df494d2aaf59c4c
7+
winnt-i386 2c5c5f7228140cd79f120201805504a9e07ad245
8+
19
S 2014-02-03 346d378
210
freebsd-x86_64 d369c1a83a2be6eb42bd0e550a1adc38ffed0804
311
linux-i386 a6d4ab441f5b285d7aecbb940fa733526b413f34

0 commit comments

Comments
 (0)