(self, index: int)
| 64 | return self._chunks |
| 65 | |
| 66 | def _get_chunk_at(self, index: int) -> "AllocatedArrayPointer[T]": |
| 67 | if index > self.chunks: |
| 68 | raise IndexError( |
| 69 | f"index is {index}, while allocation is {self.chunks}", |
| 70 | ) |
| 71 | |
| 72 | if index < 0: # for handling __sub__ |
| 73 | raise IndexError("index is below zero") |
| 74 | |
| 75 | if index not in self._chunk_store: |
| 76 | self._chunk_store[index] = AllocatedArrayPointer( |
| 77 | self._origin_address + (index * self.size), |
| 78 | self.chunks, |
| 79 | self.size, |
| 80 | index, |
| 81 | self._chunk_store, |
| 82 | self._freed, |
| 83 | self._origin_address, |
| 84 | ) |
| 85 | |
| 86 | return self._chunk_store[index] |
| 87 | |
| 88 | def __add__(self, amount: int) -> "AllocatedArrayPointer[T]": |
| 89 | self.ensure_valid() |
no test coverage detected