(&self, index: usize)
| 302 | /// Panics if index >= self.num_buffers() or the buffer is not correctly aligned |
| 303 | #[inline] |
| 304 | pub fn buffer(&self, index: usize) -> *const u8 { |
| 305 | assert!(!self.buffers.is_null()); |
| 306 | assert!(index < self.num_buffers()); |
| 307 | // SAFETY: |
| 308 | // If buffers is not null must be valid for reads up to num_buffers |
| 309 | unsafe { std::ptr::read_unaligned((self.buffers as *mut *const u8).add(index)) } |
| 310 | } |
| 311 | |
| 312 | /// Returns the number of buffers |
| 313 | #[inline] |
no test coverage detected