| 194 | } |
| 195 | |
| 196 | void LayoutBase::MemoryLayoutItem::writeArrayElement(uint8* dataStart, int index, const var& newValue, Result* r) |
| 197 | { |
| 198 | if (isPositiveAndBelow(index, elementSize - 1)) |
| 199 | { |
| 200 | auto ptr = dataStart + Helpers::getTypeSize(type) * index; |
| 201 | jassert(allocator->validMemoryAccess(ptr)); |
| 202 | Helpers::writeElement(type, ptr, newValue); |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | if (r != nullptr) |
| 207 | *r = Result::fail("out of bounds"); |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | var LayoutBase::MemoryLayoutItem::getData(uint8* dataStart, Result* r) const |
| 212 | { |
nothing calls this directly
no test coverage detected