| 219 | } |
| 220 | |
| 221 | void MemoryBlock::copyFrom (const void* const src, int offset, size_t num) noexcept |
| 222 | { |
| 223 | auto* d = static_cast<const char*> (src); |
| 224 | |
| 225 | if (offset < 0) |
| 226 | { |
| 227 | d -= offset; |
| 228 | num += (size_t) -offset; |
| 229 | offset = 0; |
| 230 | } |
| 231 | |
| 232 | if ((size_t) offset + num > size) |
| 233 | num = size - (size_t) offset; |
| 234 | |
| 235 | if (num > 0) |
| 236 | memcpy (data + offset, d, num); |
| 237 | } |
| 238 | |
| 239 | void MemoryBlock::copyTo (void* const dst, int offset, size_t num) const noexcept |
| 240 | { |
no outgoing calls