Skip to content

Commit f9e2dce

Browse files
committed
tiny_alloc_4_e_4_elems_or_at_least_32_bytes
1 parent 088127a commit f9e2dce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/liballoc/raw_vec.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,11 @@ fn amortized_new_capacity(elem_size: usize, current_capacity: usize,
218218
// Empty vector => at least 64 bytes
219219
//
220220
// [OLD]:
221-
0 => if elem_size > (!0) / 8 { 1 } else { 4 },
221+
// 0 => if elem_size > (!0) / 8 { 1 } else { 4 },
222222
// [NEW]:
223223
// 0 => (64 / elem_size).max(1),
224+
// [NEW 2]:
225+
0 => (32 / elem_size).max(4),
224226
//
225227
// Small and large vectors (<= 4096 bytes, and >= 4096 * 32 bytes):
226228
//

0 commit comments

Comments
 (0)