about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-24 03:21:24 -0700
committerbors <bors@rust-lang.org>2014-05-24 03:21:24 -0700
commite72a21b2bb6b889a991229a966a9243b6d81e4d0 (patch)
tree4f0cc6ac953bdfd6629027f0dba0b0c6a2403b9d /src/libstd
parent12467989c3562eee5d7556e20bdc5d0d115c2cf1 (diff)
parent2fd484172406a25e11f0f83000daeef7a287aebb (diff)
downloadrust-e72a21b2bb6b889a991229a966a9243b6d81e4d0.tar.gz
rust-e72a21b2bb6b889a991229a966a9243b6d81e4d0.zip
auto merge of #14392 : alexcrichton/rust/mem-updates, r=sfackler
* All of the *_val functions have gone from #[unstable] to #[stable]
* The overwrite and zeroed functions have gone from #[unstable] to #[stable]
* The uninit function is now deprecated, replaced by its stable counterpart,
  uninitialized

[breaking-change]
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/c_str.rs2
-rw-r--r--src/libstd/os.rs4
-rw-r--r--src/libstd/rt/thread.rs4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs
index 4622c0934fe..fbb812d3fb3 100644
--- a/src/libstd/c_str.rs
+++ b/src/libstd/c_str.rs
@@ -377,7 +377,7 @@ impl<'a> ToCStr for &'a [u8] {
 // Unsafe function that handles possibly copying the &[u8] into a stack array.
 unsafe fn with_c_str<T>(v: &[u8], checked: bool, f: |*libc::c_char| -> T) -> T {
     if v.len() < BUF_LEN {
-        let mut buf: [u8, .. BUF_LEN] = mem::uninit();
+        let mut buf: [u8, .. BUF_LEN] = mem::uninitialized();
         slice::bytes::copy_memory(buf, v);
         buf[v.len()] = 0;
 
diff --git a/src/libstd/os.rs b/src/libstd/os.rs
index 493dd86b276..21903f6b6b8 100644
--- a/src/libstd/os.rs
+++ b/src/libstd/os.rs
@@ -969,7 +969,7 @@ pub fn page_size() -> uint {
 pub fn page_size() -> uint {
     use mem;
     unsafe {
-        let mut info = mem::uninit();
+        let mut info = mem::zeroed();
         libc::GetSystemInfo(&mut info);
 
         return info.dwPageSize as uint;
@@ -1288,7 +1288,7 @@ impl MemoryMap {
     pub fn granularity() -> uint {
         use mem;
         unsafe {
-            let mut info = mem::uninit();
+            let mut info = mem::zeroed();
             libc::GetSystemInfo(&mut info);
 
             return info.dwAllocationGranularity as uint;
diff --git a/src/libstd/rt/thread.rs b/src/libstd/rt/thread.rs
index e25fa4734d5..6cc9604dc59 100644
--- a/src/libstd/rt/thread.rs
+++ b/src/libstd/rt/thread.rs
@@ -227,8 +227,8 @@ mod imp {
     pub type rust_thread_return = *u8;
 
     pub unsafe fn create(stack: uint, p: Box<proc():Send>) -> rust_thread {
-        let mut native: libc::pthread_t = mem::uninit();
-        let mut attr: libc::pthread_attr_t = mem::uninit();
+        let mut native: libc::pthread_t = mem::zeroed();
+        let mut attr: libc::pthread_attr_t = mem::zeroed();
         assert_eq!(pthread_attr_init(&mut attr), 0);
         assert_eq!(pthread_attr_setdetachstate(&mut attr,
                                                PTHREAD_CREATE_JOINABLE), 0);