about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-07-10 15:46:03 -0400
committerDaniel Micay <danielmicay@gmail.com>2013-07-11 02:17:08 -0400
commit00da76dfbe3aba8c1ec399ecfa0eae4b4ba6885e (patch)
treec89723a9ea824c9d41ffefe8cef5a574a2a655b1 /src/libstd
parentfd5f8d90c5cc593e6aa43a978a1498f88558cc39 (diff)
downloadrust-00da76dfbe3aba8c1ec399ecfa0eae4b4ba6885e.tar.gz
rust-00da76dfbe3aba8c1ec399ecfa0eae4b4ba6885e.zip
vec: rm inline(never) hack
just avoid giving an inline hint in the first place
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/vec.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 5576b4ad704..38212d0f29f 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -1136,7 +1136,6 @@ impl<T> OwnedVector<T> for ~[T] {
      *
      * * n - The number of elements to reserve space for
      */
-    #[inline]
     #[cfg(stage0)]
     fn reserve(&mut self, n: uint) {
         // Only make the (slow) call into the runtime if we have to
@@ -1170,7 +1169,6 @@ impl<T> OwnedVector<T> for ~[T] {
      *
      * * n - The number of elements to reserve space for
      */
-    #[inline]
     #[cfg(not(stage0))]
     fn reserve(&mut self, n: uint) {
         // Only make the (slow) call into the runtime if we have to
@@ -1228,21 +1226,12 @@ impl<T> OwnedVector<T> for ~[T] {
             let repr: **raw::VecRepr = transmute(&mut *self);
             let fill = (**repr).unboxed.fill;
             if (**repr).unboxed.alloc <= fill {
-                // need more space
-                reserve_no_inline(self);
+                let new_len = self.len() + 1;
+                self.reserve_at_least(new_len);
             }
 
             self.push_fast(t);
         }
-
-        // this peculiar function is because reserve_at_least is very
-        // large (because of reserve), and will be inlined, which
-        // makes push too large.
-        #[inline(never)]
-        fn reserve_no_inline<T>(v: &mut ~[T]) {
-            let new_len = v.len() + 1;
-            v.reserve_at_least(new_len);
-        }
     }
 
     // This doesn't bother to make sure we have space.