MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / profile_alloc

Method profile_alloc

Src/Base/AMReX_Arena.cpp:911–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

909#endif
910
911void Arena::ArenaProfiler::profile_alloc ([[maybe_unused]] void* ptr,
912 [[maybe_unused]] std::size_t nbytes) {
913#ifdef AMREX_TINY_PROFILING
914 if (m_do_profiling) {
915 std::scoped_lock lock(m_arena_profiler_mutex);
916 MemStat* stat = TinyProfiler::memory_alloc(nbytes, m_profiling_stats);
917 if (stat) {
918 m_currently_allocated.insert({ptr, {stat, nbytes}});
919 }
920 }
921#endif
922}
923
924void Arena::ArenaProfiler::profile_free ([[maybe_unused]] void* ptr) {
925#ifdef AMREX_TINY_PROFILING

Callers 3

allocMethod · 0.80
allocMethod · 0.80
allocMethod · 0.80

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected