vecmem 1.14.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
memory_monitor.hpp
1/*
2 * VecMem project, part of the ACTS project (R&D line)
3 *
4 * (c) 2021 CERN for the benefit of the ACTS project
5 *
6 * Mozilla Public License Version 2.0
7 */
8
9#pragma once
10
11// Local include(s).
12#include "vecmem/memory/instrumenting_memory_resource.hpp"
13#include "vecmem/vecmem_core_export.hpp"
14
15// System include(s).
16#include <cstddef>
17
18namespace vecmem {
19
30
31public:
34
36 std::size_t total_allocation() const;
38 std::size_t outstanding_allocation() const;
40 std::size_t average_allocation() const;
42 std::size_t maximal_allocation() const;
43
44private:
47
49 void post_allocate(std::size_t size, std::size_t align, void* ptr);
51 void pre_deallocate(void* ptr, std::size_t size, std::size_t align);
52
54
56 std::size_t m_n_alloc = 0;
58 std::size_t m_total_alloc = 0;
60 std::size_t m_outstanding_alloc = 0;
62 std::size_t m_maximum_alloc = 0;
63
64}; // class memory_monitor
65
66} // namespace vecmem
This memory resource forwards allocation and deallocation requests to the upstream resource while rec...
Definition instrumenting_memory_resource.hpp:38
Class collecting some basic set of memory allocation statistics.
Definition memory_monitor.hpp:29
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35