v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8-external-memory-accounter.h
Go to the documentation of this file.
1
// Copyright 2024 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_EXTERNAL_MEMORY_ACCOUNTER_H_
6
#define INCLUDE_EXTERNAL_MEMORY_ACCOUNTER_H_
7
8
#include <stdint.h>
9
10
#include "
v8-isolate.h
"
11
12
namespace
v8
{
13
23
class
V8_EXPORT
ExternalMemoryAccounter
{
24
public
:
28
static
int64_t GetTotalAmountOfExternalAllocatedMemoryForTesting(
29
const
Isolate
* isolate);
30
31
ExternalMemoryAccounter
() =
default
;
32
~ExternalMemoryAccounter
();
33
ExternalMemoryAccounter
(
ExternalMemoryAccounter
&&);
34
ExternalMemoryAccounter
& operator=(
ExternalMemoryAccounter
&&);
35
ExternalMemoryAccounter
(
const
ExternalMemoryAccounter
&) =
delete
;
36
ExternalMemoryAccounter
&
operator=
(
const
ExternalMemoryAccounter
&) =
delete
;
37
41
void
Increase(
Isolate
* isolate,
size_t
size);
45
void
Update(
Isolate
* isolate, int64_t delta);
49
void
Decrease(
Isolate
* isolate,
size_t
size);
50
51
private
:
52
#ifdef V8_ENABLE_MEMORY_ACCOUNTING_CHECKS
53
size_t
amount_of_external_memory_ = 0;
54
v8::Isolate
*
isolate_
=
nullptr
;
55
#endif
56
};
57
58
}
// namespace v8
59
60
#endif
// INCLUDE_EXTERNAL_MEMORY_ACCOUNTER_H_
isolate_
Isolate * isolate_
Definition
api-natives.cc:37
v8::ExternalMemoryAccounter
Definition
v8-external-memory-accounter.h:23
v8::ExternalMemoryAccounter::ExternalMemoryAccounter
ExternalMemoryAccounter()=default
v8::ExternalMemoryAccounter::ExternalMemoryAccounter
ExternalMemoryAccounter(const ExternalMemoryAccounter &)=delete
v8::ExternalMemoryAccounter::operator=
ExternalMemoryAccounter & operator=(const ExternalMemoryAccounter &)=delete
v8::Isolate
Definition
v8-isolate.h:274
v8
Definition
api-arguments-inl.h:19
v8-isolate.h
V8_EXPORT
#define V8_EXPORT
Definition
v8config.h:800
include
v8-external-memory-accounter.h
Generated on Sun Apr 6 2025 21:08:50 for v8 by
1.12.0