mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:39:49 +00:00
f9a6a5bdd2
TEST=build Change-Id: I2834ef7cf7cb7c8770f8167a2438cbedcee5c623 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292063 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
18 lines
602 B
C++
18 lines
602 B
C++
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/memory_region.h"
|
|
|
|
namespace dart {
|
|
|
|
void MemoryRegion::CopyFrom(uword offset, const MemoryRegion& from) const {
|
|
ASSERT(from.pointer() != nullptr && from.size() > 0);
|
|
ASSERT(this->size() >= from.size());
|
|
ASSERT(offset <= this->size() - from.size());
|
|
memmove(reinterpret_cast<void*>(start() + offset), from.pointer(),
|
|
from.size());
|
|
}
|
|
|
|
} // namespace dart
|