MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / mut_slices

Method mut_slices

cranelift/entity/src/list.rs:236–244  ·  view source on GitHub ↗

Returns two mutable slices representing the two requested blocks. The two returned slices can be longer than the blocks. Each block is located at the front of the respective slice.

(&mut self, block0: usize, block1: usize)

Source from the content-addressed store, hash-verified

234 /// The two returned slices can be longer than the blocks. Each block is located at the front
235 /// of the respective slice.
236 fn mut_slices(&mut self, block0: usize, block1: usize) -> (&mut [T], &mut [T]) {
237 if block0 < block1 {
238 let (s0, s1) = self.data.split_at_mut(block1);
239 (&mut s0[block0..], s1)
240 } else {
241 let (s1, s0) = self.data.split_at_mut(block0);
242 (s0, &mut s1[block1..])
243 }
244 }
245
246 /// Reallocate a block to a different size class.
247 ///

Callers 1

reallocMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected