v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
platform.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 V8_HEAP_CPPGC_PLATFORM_H_
6#define V8_HEAP_CPPGC_PLATFORM_H_
7
8#include <string>
9
12#include "src/base/macros.h"
13
14namespace cppgc::internal {
15
16class HeapBase;
17
19 public:
20 using Callback = void(const std::string&, const SourceLocation&, HeapBase*);
21
24
25 [[noreturn]] void operator()(
26 const std::string& reason = std::string(),
27 const SourceLocation& = SourceLocation::Current()) const;
28
29 void SetCustomHandler(Callback*);
30
31 // Disallow copy/move.
34
35 private:
36 HeapBase* heap_ = nullptr;
37 Callback* custom_handler_ = nullptr;
38};
39
40// Gets the global OOM handler that is not bound to any specific Heap instance.
42
43// Gets the gobal PageAllocator that is not bound to any specific Heap instance.
45
46} // namespace cppgc::internal
47
48#endif // V8_HEAP_CPPGC_PLATFORM_H_
FatalOutOfMemoryHandler(const FatalOutOfMemoryHandler &)=delete
FatalOutOfMemoryHandler & operator=(const FatalOutOfMemoryHandler &)=delete
void(const std::string &, const SourceLocation &, HeapBase *) Callback
Definition platform.h:20
PageAllocator & GetGlobalPageAllocator()
Definition platform.cc:78
FatalOutOfMemoryHandler & GetGlobalOOMHandler()
Definition platform.cc:73
#define V8_EXPORT_PRIVATE
Definition macros.h:460
Heap * heap_