ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
Macros | Functions
mem.h File Reference

Platform specific memory utilities. More...

#include <arch/platform.h>
#include <stddef.h>
#include <stdlib.h>
Include dependency graph for mem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define mem_aligned_alloc(align, mem_size)   aligned_alloc(align, mem_size)
 An OS-dependent function to allocate aligned memory.
 
#define mem_aligned_free(mem)   free(mem)
 An OS-dependent function to free aligned memory.
 

Functions

int mem_stat_setup (void)
 Initialize the platform specific memory statistics facilities. More...
 
size_t mem_stat_rss_max_get (void)
 Get the maximum size of the resident set since program beginning. More...
 
size_t mem_stat_rss_current_get (void)
 Get the current size of the resident set. More...
 

Detailed Description

Platform specific memory utilities.

This header exposes some memory related utilities such as memory statistics retrieval in a platform independent way

Function Documentation

◆ mem_stat_rss_current_get()

mem_stat_rss_current_get ( void  )

Get the current size of the resident set.

Returns
the size in bytes of the current resident set, 0 if unsuccessful

◆ mem_stat_rss_max_get()

mem_stat_rss_max_get ( void  )

Get the maximum size of the resident set since program beginning.

Returns
the size in bytes of the maximal resident set, 0 if unsuccessful

◆ mem_stat_setup()

mem_stat_setup ( void  )

Initialize the platform specific memory statistics facilities.

Returns
0 if successful, -1 otherwise