OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/memory_region.h" | 5 #include "vm/memory_region.h" |
6 | 6 |
7 namespace dart { | 7 namespace dart { |
8 | 8 |
9 void MemoryRegion::CopyFrom(uword offset, const MemoryRegion& from) const { | 9 void MemoryRegion::CopyFrom(uword offset, const MemoryRegion& from) const { |
10 ASSERT(from.pointer() != NULL && from.size() > 0); | 10 ASSERT(from.pointer() != NULL && from.size() > 0); |
11 ASSERT(this->size() >= from.size()); | 11 ASSERT(this->size() >= from.size()); |
12 ASSERT(offset <= this->size() - from.size()); | 12 ASSERT(offset <= this->size() - from.size()); |
13 memmove(reinterpret_cast<void*>(start() + offset), | 13 memmove(reinterpret_cast<void*>(start() + offset), from.pointer(), |
14 from.pointer(), from.size()); | 14 from.size()); |
15 } | 15 } |
16 | 16 |
17 } // namespace dart | 17 } // namespace dart |
OLD | NEW |