8#include <sys/resource.h>
22 static inline void* safe_memcpy(
void* dest,
const void* src,
size_t count)
24 return ::memcpy(dest, src, count);
27 static inline bool get_mallinfo(MallocInfo& info)
31 auto rc = getrusage(RUSAGE_SELF, &ru);
36 const auto heap_size = ru.ru_maxrss * 1024;
38 info.current_allocated_heap_size = heap_size;
39 info.peak_allocated_heap_size = heap_size;
44 auto rc = getrlimit(RLIMIT_AS, &rl);
50 info.max_total_heap_size = rl.rlim_cur;
Definition attestation.h:13
size_t current_allocated_heap_size
Definition mem.h:18
size_t max_total_heap_size
Definition mem.h:17
size_t peak_allocated_heap_size
Definition mem.h:19