Lines Matching defs:buf
506 let mut buf = Vec::with_capacity(capacity);
508 // `2^expn` repetition is done by doubling `buf` `expn`-times.
509 buf.extend(self);
514 // `buf.extend(buf)`:
517 buf.as_ptr(),
518 (buf.as_mut_ptr() as *mut T).add(buf.len()),
519 buf.len(),
521 // `buf` has capacity of `self.len() * n`.
522 let buf_len = buf.len();
523 buf.set_len(buf_len * 2);
531 // first `rem` repetitions from `buf` itself.
532 let rem_len = capacity - buf.len(); // `self.len() * rem`
534 // `buf.extend(buf[0 .. rem_len])`:
538 buf.as_ptr(),
539 (buf.as_mut_ptr() as *mut T).add(buf.len()),
542 // `buf.len() + rem_len` equals to `buf.capacity()` (`= self.len() * n`).
543 buf.set_len(capacity);
546 buf