diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-05-07 15:54:06 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-05-14 14:52:07 -0700 |
| commit | 329dfcaba0af7af736ac7e853be45783ad7ac4b0 (patch) | |
| tree | 1cfdbcf76ce8c05ea6c4198811985a976dfc233b | |
| parent | 52f015acebd7b1fa4fb040aa40d94416f053de24 (diff) | |
| download | rust-329dfcaba0af7af736ac7e853be45783ad7ac4b0.tar.gz rust-329dfcaba0af7af736ac7e853be45783ad7ac4b0.zip | |
core: Move unstable::exchange_alloc to rt::global_heap
| -rw-r--r-- | src/libcore/os.rs | 2 | ||||
| -rw-r--r-- | src/libcore/rt/global_heap.rs (renamed from src/libcore/unstable/exchange_alloc.rs) | 0 | ||||
| -rw-r--r-- | src/libcore/rt/mod.rs | 5 | ||||
| -rw-r--r-- | src/libcore/unstable.rs | 2 | ||||
| -rw-r--r-- | src/libcore/unstable/lang.rs | 6 |
5 files changed, 8 insertions, 7 deletions
diff --git a/src/libcore/os.rs b/src/libcore/os.rs index d983377245c..022204fa69b 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -724,7 +724,7 @@ pub fn list_dir(p: &Path) -> ~[~str] { use os::win32::{ as_utf16_p }; - use unstable::exchange_alloc::{malloc_raw, free_raw}; + use rt::global_heap::{malloc_raw, free_raw}; #[nolink] extern { unsafe fn rust_list_dir_wfd_size() -> libc::size_t; diff --git a/src/libcore/unstable/exchange_alloc.rs b/src/libcore/rt/global_heap.rs index 57ed579e88d..57ed579e88d 100644 --- a/src/libcore/unstable/exchange_alloc.rs +++ b/src/libcore/rt/global_heap.rs diff --git a/src/libcore/rt/mod.rs b/src/libcore/rt/mod.rs index b2ba6d7d3c4..55f777ebf9a 100644 --- a/src/libcore/rt/mod.rs +++ b/src/libcore/rt/mod.rs @@ -14,7 +14,10 @@ use libc::c_char; -/// The Scheduler and Task types +/// The global (exchange) heap. +pub mod global_heap; + +/// The Scheduler and Task types. mod sched; /// Thread-local access to the current Scheduler diff --git a/src/libcore/unstable.rs b/src/libcore/unstable.rs index 25e4d07b01d..9530d7ab50d 100644 --- a/src/libcore/unstable.rs +++ b/src/libcore/unstable.rs @@ -26,8 +26,6 @@ pub mod global; pub mod finally; #[path = "unstable/weak_task.rs"] pub mod weak_task; -#[path = "unstable/exchange_alloc.rs"] -pub mod exchange_alloc; #[path = "unstable/intrinsics.rs"] pub mod intrinsics; #[path = "unstable/simd.rs"] diff --git a/src/libcore/unstable/lang.rs b/src/libcore/unstable/lang.rs index 8153c2d43d9..e521fb59fbe 100644 --- a/src/libcore/unstable/lang.rs +++ b/src/libcore/unstable/lang.rs @@ -16,12 +16,12 @@ use libc::{c_char, c_uchar, c_void, size_t, uintptr_t, c_int, STDERR_FILENO}; use managed::raw::BoxRepr; use str; use sys; -use unstable::exchange_alloc; use cast::transmute; use rt::{context, OldTaskContext}; use rt::local_services::borrow_local_services; use option::{Option, Some, None}; use io; +use rt::global_heap; #[allow(non_camel_case_types)] pub type rust_task = c_void; @@ -153,7 +153,7 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) { #[lang="exchange_malloc"] #[inline(always)] pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char { - transmute(exchange_alloc::malloc(transmute(td), transmute(size))) + transmute(global_heap::malloc(transmute(td), transmute(size))) } /// Because this code is so perf. sensitive, use a static constant so that @@ -233,7 +233,7 @@ impl DebugPrints for io::fd_t { #[lang="exchange_free"] #[inline(always)] pub unsafe fn exchange_free(ptr: *c_char) { - exchange_alloc::free(transmute(ptr)) + global_heap::free(transmute(ptr)) } #[lang="malloc"] |
