Skip to content
This repository was archived by the owner on Jan 10, 2026. It is now read-only.

Commit e306f46

Browse files
performance???
1 parent 9eaf276 commit e306f46

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

sof-rs/src/runtime.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,14 @@ impl<'gc> Stack<'gc> {
8888
pub fn push_n(&mut self, values: impl ExactSizeIterator<Item = Stackable<'gc>>) {
8989
let needed_size = values.len();
9090
self.main.reserve(needed_size);
91-
for value in values {
92-
// FIXME: could be some kind of unchecked push since reserve guarantees space
93-
self.main.push(value);
91+
for (i, value) in values.enumerate() {
92+
unsafe {
93+
let end = self.main.as_mut_ptr().add(self.main.len() + i);
94+
end.write(value);
95+
}
96+
}
97+
unsafe {
98+
self.main.set_len(self.main.len() + needed_size);
9499
}
95100
}
96101

0 commit comments

Comments
 (0)