Skip to content

Commit

Permalink
reserve() was not annotated with free
Browse files Browse the repository at this point in the history
  • Loading branch information
the8472 committed Oct 9, 2020
1 parent aa4a4ac commit 1885f38
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions library/alloc/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2390,34 +2390,34 @@ impl<T> SpecExtend<T, IntoIter<T>> for Vec<T> {
//
// # illustration of some extend scenarios (not exhaustive)
//
// == step == == memory == == self == == iter / v ==
// 0123456789abcdef0123456789abcdef
// 0---------------1---------------
// = step == == memory == == self == == iter / v ==
// 0123456789abcdef0123456789abcdef
// 0---------------1---------------
//
// ## non-empty self, partially consumed iterator
//
// [initial] AAAA_-----__BBB___-------------- Vec(0x00, 4, 5) IntoIter(0x0a, 0x0c, 0x0f, 8)
// ³ into_vec AAAA_-----____BBB_-------------- Vec(0x00, 4, 5) Vec(0x0a, 7, 8)
// ² prepend _____-----AAAABBB_-------------- Vec(0x00, 0, 5) Vec(0x0a, 7, 8)
// ⁴ *self = v ----------AAAABBB_-------------- Vec(0x0a, 7, 8)
// [initial] AAAA_-----__BBB___-------------- Vec(0x00, 4, 5) IntoIter(0x0a, 0x0c, 0x0f, 8)
// ³ into_vec AAAA_-----____BBB_-------------- Vec(0x00, 4, 5) Vec(0x0a, 7, 8)
// ² prepend _____-----AAAABBB_-------------- Vec(0x00, 0, 5) Vec(0x0a, 7, 8)
// ⁴ *self = v ----------AAAABBB_-------------- Vec(0x0a, 7, 8)
//
// ## empty self, partially consumed iterator
//
// [initial] ____------__BBBB__-------------- Vec(0x00, 0, 4) IntoIter(0x0a, 0x0c, 0x10, 8)
// ³ into_vec ____------BBBB____-------------- Vec(0x00, 0, 4) Vec(0x0a, 4, 8)
// ⁴ *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
// [initial] ____------__BBBB__-------------- Vec(0x00, 0, 4) IntoIter(0x0a, 0x0c, 0x10, 8)
// ³ into_vec ____------BBBB____-------------- Vec(0x00, 0, 4) Vec(0x0a, 4, 8)
// ⁴ *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
//
// ## empty self, pristine iterator
//
// [initial] ----------BBBB____-------------- Vec(0x00, 0, 0) IntoIter(0x0a, 0x0a, 0x0e, 8)
// *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
// [initial] ----------BBBB____-------------- Vec(0x00, 0, 0) IntoIter(0x0a, 0x0a, 0x0e, 8)
// *self = v ----------BBBB____-------------- Vec(0x0a, 4, 8)
//
// ## insufficient capacity
//
// [initial] AAAAA-----BBBBBB__-------------- Vec(0x00, 5, 5) IntoIter(0x0a, 0x0a, 0x0f, 8)
// ¹² reserve(6) ----------BBBBBB__--AAAAA______- Vec(0x14, 5, 11) IntoIter(0x0a, 0x0a, 0x0f, 8)
// ² ptr:copy_n ----------________--AAAAABBBBBB- Vec(0x14, 11, 11) IntoIter(0x0a, 0x0f, 0x0f, 8)
// ⁴ drop --------------------AAAAABBBBBB- Vec(0x14, 11, 11)
// [initial] AAAAA-----BBBBBB__-------------- Vec(0x00, 5, 5) IntoIter(0x0a, 0x0a, 0x0f, 8)
// ¹² reserve(6) ----------BBBBBB__--AAAAA______- Vec(0x14, 5, 11) IntoIter(0x0a, 0x0a, 0x0f, 8)
// ² ptr:copy_n ----------________--AAAAABBBBBB- Vec(0x14, 11, 11) IntoIter(0x0a, 0x0f, 0x0f, 8)
// ⁴ drop --------------------AAAAABBBBBB- Vec(0x14, 11, 11)
//
// ¹ malloc
// ² memcpy
Expand Down

0 comments on commit 1885f38

Please sign in to comment.