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
12namespace v8 {
13
24 public:
29 const Isolate* isolate);
30
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_
Definition: v8-external-memory-accounter.h:23
void Decrease(Isolate *isolate, size_t size)
static int64_t GetTotalAmountOfExternalAllocatedMemoryForTesting(const Isolate *isolate)
ExternalMemoryAccounter(ExternalMemoryAccounter &&)
void Update(Isolate *isolate, int64_t delta)
ExternalMemoryAccounter(const ExternalMemoryAccounter &)=delete
ExternalMemoryAccounter & operator=(const ExternalMemoryAccounter &)=delete
ExternalMemoryAccounter & operator=(ExternalMemoryAccounter &&)
void Increase(Isolate *isolate, size_t size)
Definition: v8-isolate.h:261
Definition: libplatform.h:15
#define V8_EXPORT
Definition: v8config.h:793