v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-memory-span.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_MEMORY_SPAN_H_
6#define INCLUDE_V8_MEMORY_SPAN_H_
7
8#include <stddef.h>
9
10#include "v8config.h" // NOLINT(build/include_directory)
11
12namespace v8 {
13
24template <typename T>
26 public:
28 constexpr MemorySpan() = default;
29
30 constexpr MemorySpan(T* data, size_t size) : data_(data), size_(size) {}
31
33 constexpr T* data() const { return data_; }
35 constexpr size_t size() const { return size_; }
36
37 private:
38 T* data_ = nullptr;
39 size_t size_ = 0;
40};
41
42} // namespace v8
43#endif // INCLUDE_V8_MEMORY_SPAN_H_
constexpr MemorySpan(T *data, size_t size)
constexpr T * data() const
constexpr MemorySpan()=default
constexpr size_t size() const
#define V8_EXPORT
Definition v8config.h:578