about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs8
-rw-r--r--src/liballoc/boxed_test.rs10
-rw-r--r--src/liballoc/heap.rs87
-rw-r--r--src/liballoc/lib.rs1
-rw-r--r--src/liballoc/rc.rs18
5 files changed, 62 insertions, 62 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 24b4abbff4a..0617c604121 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -206,12 +206,12 @@ impl<T> Arc<T> {
 /// Get the number of weak references to this value.
 #[inline]
 #[unstable(feature = "alloc")]
-pub fn weak_count<T>(this: &Arc<T>) -> uint { this.inner().weak.load(SeqCst) - 1 }
+pub fn weak_count<T>(this: &Arc<T>) -> usize { this.inner().weak.load(SeqCst) - 1 }
 
 /// Get the number of strong references to this value.
 #[inline]
 #[unstable(feature = "alloc")]
-pub fn strong_count<T>(this: &Arc<T>) -> uint { this.inner().strong.load(SeqCst) }
+pub fn strong_count<T>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst) }
 
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T> Clone for Arc<T> {
@@ -649,7 +649,7 @@ mod tests {
         let (tx, rx) = channel();
 
         let _t = Thread::spawn(move || {
-            let arc_v: Arc<Vec<int>> = rx.recv().unwrap();
+            let arc_v: Arc<Vec<i32>> = rx.recv().unwrap();
             assert_eq!((*arc_v)[3], 4);
         });
 
@@ -818,5 +818,5 @@ mod tests {
 
     // Make sure deriving works with Arc<T>
     #[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Debug, Default)]
-    struct Foo { inner: Arc<int> }
+    struct Foo { inner: Arc<i32> }
 }
diff --git a/src/liballoc/boxed_test.rs b/src/liballoc/boxed_test.rs
index 8f65b8c42c9..b7bacaa0cae 100644
--- a/src/liballoc/boxed_test.rs
+++ b/src/liballoc/boxed_test.rs
@@ -22,7 +22,7 @@ use std::boxed::BoxAny;
 #[test]
 fn test_owned_clone() {
     let a = Box::new(5);
-    let b: Box<int> = a.clone();
+    let b: Box<i32> = a.clone();
     assert!(a == b);
 }
 
@@ -31,11 +31,11 @@ struct Test;
 
 #[test]
 fn any_move() {
-    let a = Box::new(8us) as Box<Any>;
+    let a = Box::new(8) as Box<Any>;
     let b = Box::new(Test) as Box<Any>;
 
-    match a.downcast::<uint>() {
-        Ok(a) => { assert!(a == Box::new(8us)); }
+    match a.downcast::<i32>() {
+        Ok(a) => { assert!(a == Box::new(8)); }
         Err(..) => panic!()
     }
     match b.downcast::<Test>() {
@@ -47,7 +47,7 @@ fn any_move() {
     let b = Box::new(Test) as Box<Any>;
 
     assert!(a.downcast::<Box<Test>>().is_err());
-    assert!(b.downcast::<Box<uint>>().is_err());
+    assert!(b.downcast::<Box<i32>>().is_err());
 }
 
 #[test]
diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs
index 1d5637a6ad6..d3d86270d1e 100644
--- a/src/liballoc/heap.rs
+++ b/src/liballoc/heap.rs
@@ -21,7 +21,7 @@ use core::ptr::PtrExt;
 /// power of 2. The alignment must be no larger than the largest supported page
 /// size on the platform.
 #[inline]
-pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
+pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
     imp::allocate(size, align)
 }
 
@@ -37,7 +37,7 @@ pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
 /// create the allocation referenced by `ptr`. The `old_size` parameter may be
 /// any value in range_inclusive(requested_size, usable_size).
 #[inline]
-pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 {
+pub unsafe fn reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8 {
     imp::reallocate(ptr, old_size, size, align)
 }
 
@@ -54,7 +54,8 @@ pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint)
 /// create the allocation referenced by `ptr`. The `old_size` parameter may be
 /// any value in range_inclusive(requested_size, usable_size).
 #[inline]
-pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> uint {
+pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: usize, size: usize,
+                                 align: usize) -> usize {
     imp::reallocate_inplace(ptr, old_size, size, align)
 }
 
@@ -66,14 +67,14 @@ pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: uint, size: uint, align
 /// create the allocation referenced by `ptr`. The `old_size` parameter may be
 /// any value in range_inclusive(requested_size, usable_size).
 #[inline]
-pub unsafe fn deallocate(ptr: *mut u8, old_size: uint, align: uint) {
+pub unsafe fn deallocate(ptr: *mut u8, old_size: usize, align: usize) {
     imp::deallocate(ptr, old_size, align)
 }
 
 /// Returns the usable size of an allocation created with the specified the
 /// `size` and `align`.
 #[inline]
-pub fn usable_size(size: uint, align: uint) -> uint {
+pub fn usable_size(size: usize, align: usize) -> usize {
     imp::usable_size(size, align)
 }
 
@@ -96,7 +97,7 @@ pub const EMPTY: *mut () = 0x1 as *mut ();
 #[cfg(not(test))]
 #[lang="exchange_malloc"]
 #[inline]
-unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 {
+unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 {
     if size == 0 {
         EMPTY as *mut u8
     } else {
@@ -109,7 +110,7 @@ unsafe fn exchange_malloc(size: uint, align: uint) -> *mut u8 {
 #[cfg(not(test))]
 #[lang="exchange_free"]
 #[inline]
-unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
+unsafe fn exchange_free(ptr: *mut u8, old_size: usize, align: usize) {
     deallocate(ptr, old_size, align);
 }
 
@@ -122,49 +123,49 @@ unsafe fn exchange_free(ptr: *mut u8, old_size: uint, align: uint) {
               target_arch = "mips",
               target_arch = "mipsel",
               target_arch = "powerpc")))]
-const MIN_ALIGN: uint = 8;
+const MIN_ALIGN: usize = 8;
 #[cfg(all(not(feature = "external_funcs"),
           not(feature = "external_crate"),
           any(target_arch = "x86",
               target_arch = "x86_64",
               target_arch = "aarch64")))]
-const MIN_ALIGN: uint = 16;
+const MIN_ALIGN: usize = 16;
 
 #[cfg(feature = "external_funcs")]
 mod imp {
     extern {
-        fn rust_allocate(size: uint, align: uint) -> *mut u8;
-        fn rust_deallocate(ptr: *mut u8, old_size: uint, align: uint);
-        fn rust_reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8;
-        fn rust_reallocate_inplace(ptr: *mut u8, old_size: uint, size: uint,
-                                   align: uint) -> uint;
-        fn rust_usable_size(size: uint, align: uint) -> uint;
+        fn rust_allocate(size: usize, align: usize) -> *mut u8;
+        fn rust_deallocate(ptr: *mut u8, old_size: usize, align: usize);
+        fn rust_reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8;
+        fn rust_reallocate_inplace(ptr: *mut u8, old_size: usize, size: usize,
+                                   align: usize) -> usize;
+        fn rust_usable_size(size: usize, align: usize) -> usize;
         fn rust_stats_print();
     }
 
     #[inline]
-    pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
         rust_allocate(size, align)
     }
 
     #[inline]
-    pub unsafe fn deallocate(ptr: *mut u8, old_size: uint, align: uint) {
+    pub unsafe fn deallocate(ptr: *mut u8, old_size: usize, align: usize) {
         rust_deallocate(ptr, old_size, align)
     }
 
     #[inline]
-    pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8 {
         rust_reallocate(ptr, old_size, size, align)
     }
 
     #[inline]
-    pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: uint, size: uint,
-                                     align: uint) -> uint {
+    pub unsafe fn reallocate_inplace(ptr: *mut u8, old_size: usize, size: usize,
+                                     align: usize) -> usize {
         rust_reallocate_inplace(ptr, old_size, size, align)
     }
 
     #[inline]
-    pub fn usable_size(size: uint, align: uint) -> uint {
+    pub fn usable_size(size: usize, align: usize) -> usize {
         unsafe { rust_usable_size(size, align) }
     }
 
@@ -215,42 +216,42 @@ mod imp {
 
     // MALLOCX_ALIGN(a) macro
     #[inline(always)]
-    fn mallocx_align(a: uint) -> c_int { a.trailing_zeros() as c_int }
+    fn mallocx_align(a: usize) -> c_int { a.trailing_zeros() as c_int }
 
     #[inline(always)]
-    fn align_to_flags(align: uint) -> c_int {
+    fn align_to_flags(align: usize) -> c_int {
         if align <= MIN_ALIGN { 0 } else { mallocx_align(align) }
     }
 
     #[inline]
-    pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
         let flags = align_to_flags(align);
         je_mallocx(size as size_t, flags) as *mut u8
     }
 
     #[inline]
-    pub unsafe fn reallocate(ptr: *mut u8, _old_size: uint, size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn reallocate(ptr: *mut u8, _old_size: usize, size: usize, align: usize) -> *mut u8 {
         let flags = align_to_flags(align);
         je_rallocx(ptr as *mut c_void, size as size_t, flags) as *mut u8
     }
 
     #[inline]
-    pub unsafe fn reallocate_inplace(ptr: *mut u8, _old_size: uint, size: uint,
-                                     align: uint) -> uint {
+    pub unsafe fn reallocate_inplace(ptr: *mut u8, _old_size: usize, size: usize,
+                                     align: usize) -> usize {
         let flags = align_to_flags(align);
-        je_xallocx(ptr as *mut c_void, size as size_t, 0, flags) as uint
+        je_xallocx(ptr as *mut c_void, size as size_t, 0, flags) as usize
     }
 
     #[inline]
-    pub unsafe fn deallocate(ptr: *mut u8, old_size: uint, align: uint) {
+    pub unsafe fn deallocate(ptr: *mut u8, old_size: usize, align: usize) {
         let flags = align_to_flags(align);
         je_sdallocx(ptr as *mut c_void, old_size as size_t, flags)
     }
 
     #[inline]
-    pub fn usable_size(size: uint, align: uint) -> uint {
+    pub fn usable_size(size: usize, align: usize) -> usize {
         let flags = align_to_flags(align);
-        unsafe { je_nallocx(size as size_t, flags) as uint }
+        unsafe { je_nallocx(size as size_t, flags) as usize }
     }
 
     pub fn stats_print() {
@@ -277,7 +278,7 @@ mod imp {
     }
 
     #[inline]
-    pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
         if align <= MIN_ALIGN {
             libc::malloc(size as libc::size_t) as *mut u8
         } else {
@@ -294,7 +295,7 @@ mod imp {
     }
 
     #[inline]
-    pub unsafe fn reallocate(ptr: *mut u8, old_size: uint, size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn reallocate(ptr: *mut u8, old_size: usize, size: usize, align: usize) -> *mut u8 {
         if align <= MIN_ALIGN {
             libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8
         } else {
@@ -306,18 +307,18 @@ mod imp {
     }
 
     #[inline]
-    pub unsafe fn reallocate_inplace(_ptr: *mut u8, old_size: uint, _size: uint,
-                                     _align: uint) -> uint {
+    pub unsafe fn reallocate_inplace(_ptr: *mut u8, old_size: usize, _size: usize,
+                                     _align: usize) -> usize {
         old_size
     }
 
     #[inline]
-    pub unsafe fn deallocate(ptr: *mut u8, _old_size: uint, _align: uint) {
+    pub unsafe fn deallocate(ptr: *mut u8, _old_size: usize, _align: usize) {
         libc::free(ptr as *mut libc::c_void)
     }
 
     #[inline]
-    pub fn usable_size(size: uint, _align: uint) -> uint {
+    pub fn usable_size(size: usize, _align: usize) -> usize {
         size
     }
 
@@ -341,7 +342,7 @@ mod imp {
     }
 
     #[inline]
-    pub unsafe fn allocate(size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 {
         if align <= MIN_ALIGN {
             libc::malloc(size as size_t) as *mut u8
         } else {
@@ -350,7 +351,7 @@ mod imp {
     }
 
     #[inline]
-    pub unsafe fn reallocate(ptr: *mut u8, _old_size: uint, size: uint, align: uint) -> *mut u8 {
+    pub unsafe fn reallocate(ptr: *mut u8, _old_size: usize, size: usize, align: usize) -> *mut u8 {
         if align <= MIN_ALIGN {
             libc::realloc(ptr as *mut c_void, size as size_t) as *mut u8
         } else {
@@ -359,13 +360,13 @@ mod imp {
     }
 
     #[inline]
-    pub unsafe fn reallocate_inplace(_ptr: *mut u8, old_size: uint, _size: uint,
-                                     _align: uint) -> uint {
+    pub unsafe fn reallocate_inplace(_ptr: *mut u8, old_size: usize, _size: usize,
+                                     _align: usize) -> usize {
         old_size
     }
 
     #[inline]
-    pub unsafe fn deallocate(ptr: *mut u8, _old_size: uint, align: uint) {
+    pub unsafe fn deallocate(ptr: *mut u8, _old_size: usize, align: usize) {
         if align <= MIN_ALIGN {
             libc::free(ptr as *mut libc::c_void)
         } else {
@@ -374,7 +375,7 @@ mod imp {
     }
 
     #[inline]
-    pub fn usable_size(size: uint, _align: uint) -> uint {
+    pub fn usable_size(size: usize, _align: usize) -> usize {
         size
     }
 
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 81391fd63eb..0e6266f9cbc 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -70,7 +70,6 @@
 #![feature(lang_items, unsafe_destructor)]
 #![feature(box_syntax)]
 #![feature(optin_builtin_traits)]
-#![feature(int_uint)]
 #![feature(unboxed_closures)]
 #![feature(core)]
 #![feature(hash)]
diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs
index 54ff4c18654..ab3c0901bc9 100644
--- a/src/liballoc/rc.rs
+++ b/src/liballoc/rc.rs
@@ -40,7 +40,7 @@
 //! }
 //!
 //! struct Gadget {
-//!     id: int,
+//!     id: i32,
 //!     owner: Rc<Owner>
 //!     // ...other fields
 //! }
@@ -99,7 +99,7 @@
 //! }
 //!
 //! struct Gadget {
-//!     id: int,
+//!     id: i32,
 //!     owner: Rc<Owner>
 //!     // ...other fields
 //! }
@@ -166,8 +166,8 @@ use heap::deallocate;
 
 struct RcBox<T> {
     value: T,
-    strong: Cell<uint>,
-    weak: Cell<uint>
+    strong: Cell<usize>,
+    weak: Cell<usize>
 }
 
 /// An immutable reference-counted pointer type.
@@ -233,12 +233,12 @@ impl<T> Rc<T> {
 /// Get the number of weak references to this value.
 #[inline]
 #[unstable(feature = "alloc")]
-pub fn weak_count<T>(this: &Rc<T>) -> uint { this.weak() - 1 }
+pub fn weak_count<T>(this: &Rc<T>) -> usize { this.weak() - 1 }
 
 /// Get the number of strong references to this value.
 #[inline]
 #[unstable(feature = "alloc")]
-pub fn strong_count<T>(this: &Rc<T>) -> uint { this.strong() }
+pub fn strong_count<T>(this: &Rc<T>) -> usize { this.strong() }
 
 /// Returns true if there are no other `Rc` or `Weak<T>` values that share the same inner value.
 ///
@@ -447,7 +447,7 @@ impl<T: Default> Default for Rc<T> {
     /// use std::rc::Rc;
     /// use std::default::Default;
     ///
-    /// let x: Rc<int> = Default::default();
+    /// let x: Rc<i32> = Default::default();
     /// ```
     #[inline]
     #[stable(feature = "rust1", since = "1.0.0")]
@@ -750,7 +750,7 @@ trait RcBoxPtr<T> {
     fn inner(&self) -> &RcBox<T>;
 
     #[inline]
-    fn strong(&self) -> uint { self.inner().strong.get() }
+    fn strong(&self) -> usize { self.inner().strong.get() }
 
     #[inline]
     fn inc_strong(&self) { self.inner().strong.set(self.strong() + 1); }
@@ -759,7 +759,7 @@ trait RcBoxPtr<T> {
     fn dec_strong(&self) { self.inner().strong.set(self.strong() - 1); }
 
     #[inline]
-    fn weak(&self) -> uint { self.inner().weak.get() }
+    fn weak(&self) -> usize { self.inner().weak.get() }
 
     #[inline]
     fn inc_weak(&self) { self.inner().weak.set(self.weak() + 1); }