v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
process-heap-statistics.h
Go to the documentation of this file.
1// Copyright 2020 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_PROCESS_HEAP_STATISTICS_H_
6#define V8_HEAP_CPPGC_PROCESS_HEAP_STATISTICS_H_
7
10
11namespace cppgc {
12namespace internal {
13
15 public:
16 // Allocation observer implementation for heaps should register to contribute
17 // to ProcessHeapStatistics. The heap is responsible for allocating and
18 // registering the observer impl with its stats collector.
50
51 // For cppgc::ProcessHeapStatistics
52 static void IncreaseTotalAllocatedObjectSize(size_t delta) {
54 delta, std::memory_order_relaxed);
55 }
56 static void DecreaseTotalAllocatedObjectSize(size_t delta) {
58 delta, std::memory_order_relaxed);
59 }
60 static void IncreaseTotalAllocatedSpace(size_t delta) {
62 delta, std::memory_order_relaxed);
63 }
64 static void DecreaseTotalAllocatedSpace(size_t delta) {
66 delta, std::memory_order_relaxed);
67 }
68};
69
70} // namespace internal
71} // namespace cppgc
72
73#endif // V8_HEAP_CPPGC_PROCESS_HEAP_STATISTICS_H_
static std::atomic_size_t total_allocated_object_size_
static std::atomic_size_t total_allocated_space_