Skip to content

Commit 2872b5f

Browse files
committed
do not inline grow_amortized
1 parent 2eb4fc8 commit 2872b5f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/alloc/src/raw_vec.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,9 @@ impl<T, A: AllocRef> RawVec<T, A> {
389389
// so that all of the code that depends on `T` is within it, while as much
390390
// of the code that doesn't depend on `T` as possible is in functions that
391391
// are non-generic over `T`.
392+
//
393+
// We never inline this function to keep `Vec::push` small.
394+
#[inline(never)]
392395
fn grow_amortized(&mut self, len: usize, additional: usize) -> Result<(), TryReserveError> {
393396
// This is ensured by the calling contexts.
394397
debug_assert!(additional > 0);

0 commit comments

Comments
 (0)