Skip to content

Commit 1885f38

Browse files
committed
reserve() was not annotated with free
1 parent aa4a4ac commit 1885f38

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

library/alloc/src/vec.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,34 +2390,34 @@ impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> {
23902390
//
23912391
// # illustration of some extend scenarios (not exhaustive)
23922392
//
2393-
// == step == == memory == == self == == iter / v ==
2394-
// 0123456789abcdef0123456789abcdef
2395-
// 0---------------1---------------
2393+
// = step == == memory == == self == == iter / v ==
2394+
// 0123456789abcdef0123456789abcdef
2395+
// 0---------------1---------------
23962396
//
23972397
// ## non-empty self, partially consumed iterator
23982398
//
2399-
// [initial] AAAA_-----__BBB___-------------- Vec(0x00, 4, 5) IntoIter(0x0a, 0x0c, 0x0f, 8)
2400-
// ³ into_vec AAAA_-----____BBB_-------------- Vec(0x00, 4, 5) Vec(0x0a, 7, 8)
2401-
// ² prepend _____-----AAAABBB_-------------- Vec(0x00, 0, 5) Vec(0x0a, 7, 8)
2402-
// ⁴ *self = v ----------AAAABBB_-------------- Vec(0x0a, 7, 8)
2399+
// [initial] AAAA_-----__BBB___-------------- Vec(0x00, 4, 5) IntoIter(0x0a, 0x0c, 0x0f, 8)
2400+
// ³ into_vec AAAA_-----____BBB_-------------- Vec(0x00, 4, 5) Vec(0x0a, 7, 8)
2401+
// ² prepend _____-----AAAABBB_-------------- Vec(0x00, 0, 5) Vec(0x0a, 7, 8)
2402+
// ⁴ *self = v ----------AAAABBB_-------------- Vec(0x0a, 7, 8)
24032403
//
24042404
// ## empty self, partially consumed iterator
24052405
//
2406-
// [initial] ____------__BBBB__-------------- Vec(0x00, 0, 4) IntoIter(0x0a, 0x0c, 0x10, 8)
2407-
// ³ into_vec ____------BBBB____-------------- Vec(0x00, 0, 4) Vec(0x0a, 4, 8)
2408-
// ⁴ *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
2406+
// [initial] ____------__BBBB__-------------- Vec(0x00, 0, 4) IntoIter(0x0a, 0x0c, 0x10, 8)
2407+
// ³ into_vec ____------BBBB____-------------- Vec(0x00, 0, 4) Vec(0x0a, 4, 8)
2408+
// ⁴ *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
24092409
//
24102410
// ## empty self, pristine iterator
24112411
//
2412-
// [initial] ----------BBBB____-------------- Vec(0x00, 0, 0) IntoIter(0x0a, 0x0a, 0x0e, 8)
2413-
// *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
2412+
// [initial] ----------BBBB____-------------- Vec(0x00, 0, 0) IntoIter(0x0a, 0x0a, 0x0e, 8)
2413+
// *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
24142414
//
24152415
// ## insufficient capacity
24162416
//
2417-
// [initial] AAAAA-----BBBBBB__-------------- Vec(0x00, 5, 5) IntoIter(0x0a, 0x0a, 0x0f, 8)
2418-
// ¹² reserve(6) ----------BBBBBB__--AAAAA______- Vec(0x14, 5, 11) IntoIter(0x0a, 0x0a, 0x0f, 8)
2419-
// ² ptr:copy_n ----------________--AAAAABBBBBB- Vec(0x14, 11, 11) IntoIter(0x0a, 0x0f, 0x0f, 8)
2420-
// ⁴ drop --------------------AAAAABBBBBB- Vec(0x14, 11, 11)
2417+
// [initial] AAAAA-----BBBBBB__-------------- Vec(0x00, 5, 5) IntoIter(0x0a, 0x0a, 0x0f, 8)
2418+
// ¹² reserve(6) ----------BBBBBB__--AAAAA______- Vec(0x14, 5, 11) IntoIter(0x0a, 0x0a, 0x0f, 8)
2419+
// ² ptr:copy_n ----------________--AAAAABBBBBB- Vec(0x14, 11, 11) IntoIter(0x0a, 0x0f, 0x0f, 8)
2420+
// ⁴ drop --------------------AAAAABBBBBB- Vec(0x14, 11, 11)
24212421
//
24222422
// ¹ malloc
24232423
// ² memcpy

0 commit comments

Comments
 (0)