Skip to content

Commit 329dfca

Browse files
committed
core: Move unstable::exchange_alloc to rt::global_heap
1 parent 52f015a commit 329dfca

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/libcore/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ pub fn list_dir(p: &Path) -> ~[~str] {
724724
use os::win32::{
725725
as_utf16_p
726726
};
727-
use unstable::exchange_alloc::{malloc_raw, free_raw};
727+
use rt::global_heap::{malloc_raw, free_raw};
728728
#[nolink]
729729
extern {
730730
unsafe fn rust_list_dir_wfd_size() -> libc::size_t;

src/libcore/rt/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414

1515
use libc::c_char;
1616

17-
/// The Scheduler and Task types
17+
/// The global (exchange) heap.
18+
pub mod global_heap;
19+
20+
/// The Scheduler and Task types.
1821
mod sched;
1922

2023
/// Thread-local access to the current Scheduler

src/libcore/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ pub mod global;
2626
pub mod finally;
2727
#[path = "unstable/weak_task.rs"]
2828
pub mod weak_task;
29-
#[path = "unstable/exchange_alloc.rs"]
30-
pub mod exchange_alloc;
3129
#[path = "unstable/intrinsics.rs"]
3230
pub mod intrinsics;
3331
#[path = "unstable/simd.rs"]

src/libcore/unstable/lang.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ use libc::{c_char, c_uchar, c_void, size_t, uintptr_t, c_int, STDERR_FILENO};
1616
use managed::raw::BoxRepr;
1717
use str;
1818
use sys;
19-
use unstable::exchange_alloc;
2019
use cast::transmute;
2120
use rt::{context, OldTaskContext};
2221
use rt::local_services::borrow_local_services;
2322
use option::{Option, Some, None};
2423
use io;
24+
use rt::global_heap;
2525

2626
#[allow(non_camel_case_types)]
2727
pub type rust_task = c_void;
@@ -153,7 +153,7 @@ unsafe fn fail_borrowed(box: *mut BoxRepr, file: *c_char, line: size_t) {
153153
#[lang="exchange_malloc"]
154154
#[inline(always)]
155155
pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
156-
transmute(exchange_alloc::malloc(transmute(td), transmute(size)))
156+
transmute(global_heap::malloc(transmute(td), transmute(size)))
157157
}
158158

159159
/// Because this code is so perf. sensitive, use a static constant so that
@@ -233,7 +233,7 @@ impl DebugPrints for io::fd_t {
233233
#[lang="exchange_free"]
234234
#[inline(always)]
235235
pub unsafe fn exchange_free(ptr: *c_char) {
236-
exchange_alloc::free(transmute(ptr))
236+
global_heap::free(transmute(ptr))
237237
}
238238

239239
#[lang="malloc"]

0 commit comments

Comments
 (0)