this should be the only way to create a memoryview from another memoryview
(&self)
| 119 | |
| 120 | /// this should be the only way to create a memoryview from another memoryview |
| 121 | pub fn new_view(&self) -> Self { |
| 122 | let zelf = Self { |
| 123 | buffer: self.buffer.clone(), |
| 124 | released: AtomicCell::new(false), |
| 125 | start: self.start, |
| 126 | format_spec: self.format_spec.clone(), |
| 127 | desc: self.desc.clone(), |
| 128 | hash: OnceCell::new(), |
| 129 | }; |
| 130 | zelf.buffer.retain(); |
| 131 | zelf |
| 132 | } |
| 133 | |
| 134 | fn try_not_released(&self, vm: &VirtualMachine) -> PyResult<()> { |
| 135 | if self.released.load() { |
no test coverage detected