diff --git a/crates/oxc_mangler/src/lib.rs b/crates/oxc_mangler/src/lib.rs index e33bb287ad25c..54b3ee02c67ec 100644 --- a/crates/oxc_mangler/src/lib.rs +++ b/crates/oxc_mangler/src/lib.rs @@ -306,9 +306,9 @@ impl<'t> Mangler<'t> { // Stores the lived scope ids for each slot. Keyed by slot number. let mut slot_liveness: std::vec::Vec = vec![]; - let mut tmp_bindings = std::vec::Vec::with_capacity(100); + let mut tmp_bindings = Vec::with_capacity_in(100, temp_allocator); - let mut reusable_slots = std::vec::Vec::new(); + let mut reusable_slots = Vec::new_in(temp_allocator); // Walk down the scope tree and assign a slot number for each symbol. // It is possible to do this in a loop over the symbol list, // but walking down the scope tree seems to generate a better code. @@ -426,8 +426,8 @@ impl<'t> Mangler<'t> { // function fa() { .. } function ga() { .. } let mut freq_iter = frequencies.iter(); - let mut symbols_renamed_in_this_batch = std::vec::Vec::with_capacity(100); - let mut slice_of_same_len_strings = std::vec::Vec::with_capacity(100); + let mut symbols_renamed_in_this_batch = Vec::with_capacity_in(100, temp_allocator); + let mut slice_of_same_len_strings = Vec::with_capacity_in(100, temp_allocator); // 2. "N number of vars are going to be assigned names of the same length" for (_, slice_of_same_len_strings_group) in &reserved_names.into_iter().chunk_by(InlineString::len)