diff --git a/src/collections/scoped_buffer.rs b/src/collections/scoped_buffer.rs index f6f62b77ed4bca0048e38c9acbb44f1261537656..5b8c08eafe6bb2756822b73b55c456787ad94d10 100644 --- a/src/collections/scoped_buffer.rs +++ b/src/collections/scoped_buffer.rs @@ -38,6 +38,17 @@ impl ScopedBuffer { cur_size: start_size } } + + pub(crate) fn start_section_initialized(&mut self, initialize_with: &[T]) -> ScopedSection { + let start_size = self.inner.len() as u32; + let data_size = initialize_with.len() as u32; + self.inner.extend_from_slice(initialize_with); + ScopedSection{ + inner: &mut self.inner, + start_size, + cur_size: start_size + data_size, + } + } } #[cfg(debug_assertions)]