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 INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_
6#define INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_
7
8#include <atomic>
9#include <cstddef>
10
11#include "v8config.h" // NOLINT(build/include_directory)
12
13namespace cppgc {
14namespace internal {
15class ProcessHeapStatisticsUpdater;
16} // namespace internal
17
19 public:
20 static size_t TotalAllocatedObjectSize() {
21 return total_allocated_object_size_.load(std::memory_order_relaxed);
22 }
23 static size_t TotalAllocatedSpace() {
24 return total_allocated_space_.load(std::memory_order_relaxed);
25 }
26
27 private:
28 static std::atomic_size_t total_allocated_space_;
29 static std::atomic_size_t total_allocated_object_size_;
30
31 friend class internal::ProcessHeapStatisticsUpdater;
32};
33
34} // namespace cppgc
35
36#endif // INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_
Definition: process-heap-statistics.h:18
static size_t TotalAllocatedSpace()
Definition: process-heap-statistics.h:23
static size_t TotalAllocatedObjectSize()
Definition: process-heap-statistics.h:20
Definition: allocation.h:38
#define V8_EXPORT
Definition: v8config.h:793