12#ifndef ARCANE_UTILS_IMEMORYINFO_H
13#define ARCANE_UTILS_IMEMORYINFO_H
17#include "arcane/utils/String.h"
18#include "arcane/utils/IFunctorWithArgument.h"
42 MemoryInfoChunk(
const void* aowner,
Int64 asize,
Int64 alloc_id,
Integer aiteration)
45 , m_alloc_id(alloc_id)
46 , m_iteration(aiteration)
51 const void* owner()
const {
return m_owner; }
52 Int64 size()
const {
return m_size; }
53 Int64 allocId()
const {
return m_alloc_id; }
54 Integer iteration()
const {
return m_iteration; }
55 const String& stackTrace()
const {
return m_stack_trace; }
59 void setOwner(
const void* o) { m_owner = o; }
60 void setStackTrace(
const String& st) { m_stack_trace = st; }
102 virtual void addInfo(
const void* owner,
const void* ptr,
Int64 size) = 0;
104 virtual void addInfo(
const void* owner,
const void* ptr,
Int64 size,
const void* old_ptr) = 0;
106 virtual void changeOwner(
const void* new_owner,
const void* ptr) = 0;
108 virtual void removeInfo(
const void* owner,
const void* ptr,
bool can_fail =
false) = 0;
110 virtual void printInfos(std::ostream& ostr) = 0;
114 virtual void beginCollect() = 0;
115 virtual void endCollect() = 0;
116 virtual bool isCollecting()
const = 0;
123 virtual void printAllocatedMemory(std::ostream& ostr,
Integer iteration) = 0;
155 virtual Int64 nbAllocation()
const = 0;
162arcaneGlobalMemoryInfo();
Interface of a functor with an argument but without a return value.
Interface for a memory usage information collector.
virtual void setIteration(Integer iteration)=0
Sets the current iteration number.
virtual void setStackTraceMinAllocSize(Int64 alloc_size)=0
Sets the minimum size of allocations whose call stack is traced.
virtual void removeOwner(const void *owner)=0
Removes the reference on owner.
virtual void createOwner(const void *owner, const TraceInfo &trace_info)=0
Creates a reference on owner with the trace info trace_info.
virtual void setTraceMng(ITraceMng *msg)=0
Sets the ITraceMng for messages.
virtual void visitAllocatedBlocks(IFunctorWithArgumentT< const MemoryInfoChunk & > *functor) const =0
Visitor over all allocated blocks.
virtual void setOwner(const void *owner, const TraceInfo &new_info)=0
Modifies the info of the reference owner.
virtual ~IMemoryInfo()
Releases resources.
virtual Int64 stackTraceMinAllocSize() const =0
Minimum size of allocations whose call stack is traced.
virtual void setKeepStackTrace(bool is_active)=0
Indicates whether call stack saving is active.
virtual bool keepStackTrace() const =0
Indicates if call stack saving is enabled.
Unicode character string.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.