Skip to content

Commit df0b0f8

Browse files
committed
---
yaml --- r: 102094 b: refs/heads/master c: 96b299e h: refs/heads/master v: v3
1 parent b3cfe55 commit df0b0f8

File tree

5 files changed

+37
-56
lines changed

5 files changed

+37
-56
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3e57808a01407be24a35f69148d20b76341b162f
2+
refs/heads/master: 96b299e1f08e2b6bbb8c03dfaa2881898dc6a0cb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/libstd/rt/local_heap.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,14 @@ impl Drop for MemoryRegion {
276276
}
277277
}
278278

279+
280+
#[cfg(not(test))]
281+
#[lang="malloc"]
282+
#[inline]
283+
pub unsafe fn local_malloc_(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 {
284+
local_malloc(drop_glue, size, align)
285+
}
286+
279287
#[inline]
280288
pub unsafe fn local_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *u8 {
281289
// FIXME: Unsafe borrow for speed. Lame.
@@ -288,7 +296,16 @@ pub unsafe fn local_malloc(drop_glue: fn(*mut u8), size: uint, align: uint) -> *
288296
}
289297
}
290298

291-
// A little compatibility function
299+
#[cfg(not(test))]
300+
#[lang="free"]
301+
#[inline]
302+
pub unsafe fn local_free_(ptr: *u8) {
303+
local_free(ptr)
304+
}
305+
306+
// NB: Calls to free CANNOT be allowed to fail, as throwing an exception from
307+
// inside a landing pad may corrupt the state of the exception handler. If a
308+
// problem occurs, call exit instead.
292309
#[inline]
293310
pub unsafe fn local_free(ptr: *u8) {
294311
// FIXME: Unsafe borrow for speed. Lame.

trunk/src/libstd/rt/unwind.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,24 @@ pub mod eabi {
376376
}
377377
}
378378

379+
#[cold]
380+
#[lang="fail_"]
381+
#[cfg(not(test))]
382+
pub fn fail_(expr: *u8, file: *u8, line: uint) -> ! {
383+
begin_unwind_raw(expr, file, line);
384+
}
385+
386+
#[cold]
387+
#[lang="fail_bounds_check"]
388+
#[cfg(not(test))]
389+
pub fn fail_bounds_check(file: *u8, line: uint, index: uint, len: uint) -> ! {
390+
use c_str::ToCStr;
391+
392+
let msg = format!("index out of bounds: the len is {} but the index is {}",
393+
len as uint, index as uint);
394+
msg.with_c_str(|buf| fail_(buf as *u8, file, line))
395+
}
396+
379397
/// This is the entry point of unwinding for things like lang items and such.
380398
/// The arguments are normally generated by the compiler, and need to
381399
/// have static lifetimes.

trunk/src/libstd/unstable/lang.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

trunk/src/libstd/unstable/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ pub mod dynamic_lib;
1717

1818
pub mod finally;
1919
pub mod simd;
20-
#[cfg(not(test))]
21-
pub mod lang;
2220
pub mod sync;
2321
pub mod mutex;
2422
pub mod stack;

0 commit comments

Comments
 (0)