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