Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
memory_profile.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <cstddef>
6#include <mutex>
7#include <ostream>
8#include <string>
9#include <vector>
10
11namespace bb::detail {
12
13// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
14extern bool use_memory_profile;
15
17 std::string stage;
19 std::string circuit_name;
20 size_t heap_mb; // live heap allocations via mallinfo2 (Linux) or peak RSS (other platforms)
21
23};
24
26 std::mutex mutex;
30
31 void add_checkpoint(const std::string& stage);
32 void set_circuit_name(const std::string& name);
33 void next_circuit();
34 void serialize_json(std::ostream& os) const;
35 void clear();
36};
37
38// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
40
41} // namespace bb::detail
bool use_memory_profile
MemoryProfile GLOBAL_MEMORY_PROFILE
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
SERIALIZATION_FIELDS(stage, circuit_index, circuit_name, heap_mb)
void add_checkpoint(const std::string &stage)
std::vector< MemoryCheckpoint > checkpoints
void serialize_json(std::ostream &os) const
void set_circuit_name(const std::string &name)