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#pragma once
8
9#include "globals.h"
10
11namespace py {
12
13class MemoryRegion {
14 public:
15 MemoryRegion(void* pointer, word size) : pointer_(pointer), size_(size) {}
16
17 void* pointer() const { return pointer_; }
18 uword size() const { return size_; }
19
20 void copyFrom(uword offset, MemoryRegion from) const;
21
22 private:
23 uword start() const { return reinterpret_cast<uword>(pointer_); }
24 uword end() const { return start() + size_; }
25
26 void* pointer_;
27 uword size_;
28};
29
30} // namespace py