about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-04-29 16:44:21 -0700
committerBrian Anderson <banderson@mozilla.com>2013-04-29 16:44:21 -0700
commit6818e241b49c03c0fe0994dbe8340e2d8f482f09 (patch)
tree11a97e5c38ff539f9d78d9a99259adc620ad67ee /src/libcore
parentabc49fdfae0b80acfa010fd6151ff8ffc229c03b (diff)
downloadrust-6818e241b49c03c0fe0994dbe8340e2d8f482f09.tar.gz
rust-6818e241b49c03c0fe0994dbe8340e2d8f482f09.zip
core: Turn off the local heap in newsched in stage0 to work around windows bustage
core won't compile in stage0 without.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/unstable/lang.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libcore/unstable/lang.rs b/src/libcore/unstable/lang.rs
index bf3bf5adc0a..cb3f399f591 100644
--- a/src/libcore/unstable/lang.rs
+++ b/src/libcore/unstable/lang.rs
@@ -90,6 +90,14 @@ pub unsafe fn exchange_free(ptr: *c_char) {
 
 #[lang="malloc"]
 #[inline(always)]
+#[cfg(stage0)] // For some reason this isn't working on windows in stage0
+pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char { 
+    return rustrt::rust_upcall_malloc_noswitch(td, size);
+}
+
+#[lang="malloc"]
+#[inline(always)]
+#[cfg(not(stage0))]
 pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
     match context() {
         OldTaskContext => {
@@ -110,6 +118,17 @@ pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
 // problem occurs, call exit instead.
 #[lang="free"]
 #[inline(always)]
+#[cfg(stage0)]
+pub unsafe fn local_free(ptr: *c_char) {
+    rustrt::rust_upcall_free_noswitch(ptr);
+}
+
+// NB: Calls to free CANNOT be allowed to fail, as throwing an exception from
+// inside a landing pad may corrupt the state of the exception handler. If a
+// problem occurs, call exit instead.
+#[lang="free"]
+#[inline(always)]
+#[cfg(not(stage0))]
 pub unsafe fn local_free(ptr: *c_char) {
     match context() {
         OldTaskContext => {