Skip to content

Commit 00da76d

Browse files
committed
vec: rm inline(never) hack
just avoid giving an inline hint in the first place
1 parent fd5f8d9 commit 00da76d

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/libstd/vec.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,6 @@ impl<T> OwnedVector<T> for ~[T] {
11361136
*
11371137
* * n - The number of elements to reserve space for
11381138
*/
1139-
#[inline]
11401139
#[cfg(stage0)]
11411140
fn reserve(&mut self, n: uint) {
11421141
// Only make the (slow) call into the runtime if we have to
@@ -1170,7 +1169,6 @@ impl<T> OwnedVector<T> for ~[T] {
11701169
*
11711170
* * n - The number of elements to reserve space for
11721171
*/
1173-
#[inline]
11741172
#[cfg(not(stage0))]
11751173
fn reserve(&mut self, n: uint) {
11761174
// Only make the (slow) call into the runtime if we have to
@@ -1228,21 +1226,12 @@ impl<T> OwnedVector<T> for ~[T] {
12281226
let repr: **raw::VecRepr = transmute(&mut *self);
12291227
let fill = (**repr).unboxed.fill;
12301228
if (**repr).unboxed.alloc <= fill {
1231-
// need more space
1232-
reserve_no_inline(self);
1229+
let new_len = self.len() + 1;
1230+
self.reserve_at_least(new_len);
12331231
}
12341232

12351233
self.push_fast(t);
12361234
}
1237-
1238-
// this peculiar function is because reserve_at_least is very
1239-
// large (because of reserve), and will be inlined, which
1240-
// makes push too large.
1241-
#[inline(never)]
1242-
fn reserve_no_inline<T>(v: &mut ~[T]) {
1243-
let new_len = v.len() + 1;
1244-
v.reserve_at_least(new_len);
1245-
}
12461235
}
12471236

12481237
// This doesn't bother to make sure we have space.

0 commit comments

Comments
 (0)