this repo has no description
1// Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
2// Copyright (c) 2013, the Dart project authors and Facebook, Inc. and its
3// affiliates. Please see the AUTHORS-Dart file for details. All rights
4// reserved. Use of this source code is governed by a BSD-style license that
5// can be found in the LICENSE-Dart file.
6
7#include "memory-region.h"
8
9#include <cstring>
10
11#include "utils.h"
12
13namespace py {
14
15void MemoryRegion::copyFrom(uword offset, MemoryRegion from) const {
16 DCHECK(size() >= from.size(), "source cannot be larger than destination");
17 DCHECK(offset <= (size() - from.size()), "offset is too large");
18 std::memmove(reinterpret_cast<void*>(start() + offset), from.pointer(),
19 from.size());
20}
21
22} // namespace py