about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-05-09 22:59:46 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-05-10 19:58:18 -0400
commit121ad1cb7db6517ed2aabc9c1514a99f5eb95149 (patch)
treeb777b0213aecc150a7a18a7cb14643657cc62afb /src/libstd/rt
parent87b658cf728b5d7e6b81012460454af634f6e6f8 (diff)
downloadrust-121ad1cb7db6517ed2aabc9c1514a99f5eb95149.tar.gz
rust-121ad1cb7db6517ed2aabc9c1514a99f5eb95149.zip
rename `global_heap` -> `libc_heap`
This module only contains wrappers for malloc and realloc with
out-of-memory checks.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/libc_heap.rs (renamed from src/libstd/rt/global_heap.rs)0
-rw-r--r--src/libstd/rt/local_heap.rs7
-rw-r--r--src/libstd/rt/mod.rs6
3 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/libc_heap.rs
index ece51ab9989..ece51ab9989 100644
--- a/src/libstd/rt/global_heap.rs
+++ b/src/libstd/rt/libc_heap.rs
diff --git a/src/libstd/rt/local_heap.rs b/src/libstd/rt/local_heap.rs
index 8795736b3f5..efc8072594b 100644
--- a/src/libstd/rt/local_heap.rs
+++ b/src/libstd/rt/local_heap.rs
@@ -18,7 +18,7 @@ use ops::Drop;
 use option::{Option, None, Some};
 use ptr;
 use ptr::RawPtr;
-use rt::global_heap;
+use rt::libc_heap;
 use rt::local::Local;
 use rt::task::Task;
 use raw;
@@ -188,7 +188,7 @@ impl MemoryRegion {
     fn malloc(&mut self, size: uint) -> *mut Box {
         let total_size = size + AllocHeader::size();
         let alloc: *AllocHeader = unsafe {
-            global_heap::malloc_raw(total_size) as *AllocHeader
+            libc_heap::malloc_raw(total_size) as *AllocHeader
         };
 
         let alloc: &mut AllocHeader = unsafe { cast::transmute(alloc) };
@@ -207,8 +207,7 @@ impl MemoryRegion {
 
         let total_size = size + AllocHeader::size();
         let alloc: *AllocHeader = unsafe {
-            global_heap::realloc_raw(orig_alloc as *mut u8,
-                                     total_size) as *AllocHeader
+            libc_heap::realloc_raw(orig_alloc as *mut u8, total_size) as *AllocHeader
         };
 
         let alloc: &mut AllocHeader = unsafe { cast::transmute(alloc) };
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 904921cfa18..a04cbabedd6 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -26,7 +26,7 @@ language and an implementation must be provided regardless of the
 execution environment.
 
 Of foremost importance is the global exchange heap, in the module
-`global_heap`. Very little practical Rust code can be written without
+`heap`. Very little practical Rust code can be written without
 access to the global heap. Unlike most of `rt` the global heap is
 truly a global resource and generally operates independently of the
 rest of the runtime.
@@ -86,8 +86,8 @@ pub mod shouldnt_be_public {
 // Internal macros used by the runtime.
 mod macros;
 
-// The global (exchange) heap.
-pub mod global_heap;
+/// Wrappers around malloc / realloc aborting on out-of-memory.
+pub mod libc_heap;
 
 /// The low-level memory allocation API.
 pub mod heap;