Basilisk CFD
Adaptive Cartesian mesh PDE framework
Loading...
Searching...
No Matches
mtrace.h File Reference

Go to the source code of this file.

Data Structures

struct  pmfunc
 
struct  pmdata
 

Functions

static int pmfunc_index (const char *func, const char *file, int line)
 
static void pmfunc_trace (pmfunc *f, char c)
 
static voidpmfunc_alloc (pmdata *d, size_t size, const char *func, const char *file, int line, char c)
 
static voidpmfunc_free (void *ptr, char c)
 
static voidpmalloc (size_t size, const char *func, const char *file, int line)
 
static voidpcalloc (size_t nmemb, size_t size, const char *func, const char *file, int line)
 
static voidprealloc (void *ptr, size_t size, const char *func, const char *file, int line)
 
static void pfree (void *ptr, const char *func, const char *file, int line)
 
static charpstrdup (const char *s, const char *func, const char *file, int line)
 
static int pmaxsort (const void *a, const void *b)
 
static int ptotalsort (const void *a, const void *b)
 
static void pmfuncs_free ()
 
void pmuntrace (void)
 

Variables

struct { 
 
   FILE *   fp 
 
   size_t   total 
 
   size_t   max 
 
   size_t   overhead 
 
   size_t   maxoverhead 
 
   size_t   nr 
 
   size_t   startrss 
 
   size_t   maxrss 
 
   char *   fname 
 
pmtrace 
 
static pmfuncpmfuncs = NULL
 
static int pmfuncn = 0
 

Function Documentation

◆ pcalloc()

static void * pcalloc ( size_t  nmemb,
size_t  size,
const char func,
const char file,
int  line 
)
static

Definition at line 142 of file mtrace.h.

References file, func, line, p, pmalloc(), size, and x.

Here is the call graph for this function:

◆ pfree()

static void pfree ( void ptr,
const char func,
const char file,
int  line 
)
static

Definition at line 157 of file mtrace.h.

References pmfunc_free(), and x.

Here is the call graph for this function:

◆ pmalloc()

static void * pmalloc ( size_t  size,
const char func,
const char file,
int  line 
)
static

Definition at line 135 of file mtrace.h.

References file, func, line, pmfunc_alloc(), size, and x.

Referenced by pcalloc(), and pstrdup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pmaxsort()

static int pmaxsort ( const void a,
const void b 
)
static

Definition at line 171 of file mtrace.h.

References a, b, and x.

Referenced by pmuntrace().

Here is the caller graph for this function:

◆ pmfunc_alloc()

static void * pmfunc_alloc ( pmdata d,
size_t  size,
const char func,
const char file,
int  line,
char  c 
)
static

Definition at line 69 of file mtrace.h.

References assert, c, d, f, file, func, line, pmfunc_index(), pmfunc_trace(), pmfuncs, pmtrace, size, and x.

Referenced by pmalloc(), and prealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pmfunc_free()

static void * pmfunc_free ( void ptr,
char  c 
)
static

Definition at line 93 of file mtrace.h.

References c, d, f, pmfunc_trace(), pmfuncn, pmfuncs, pmtrace, and x.

Referenced by pfree(), and prealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pmfunc_index()

static int pmfunc_index ( const char func,
const char file,
int  line 
)
static

Definition at line 28 of file mtrace.h.

References file, func, i, pmfunc::id, line, p, pmfuncn, pmfuncs, pmtrace, and x.

Referenced by pmfunc_alloc().

Here is the caller graph for this function:

◆ pmfunc_trace()

static void pmfunc_trace ( pmfunc f,
char  c 
)
static

Definition at line 47 of file mtrace.h.

References c, f, pmtrace, and x.

Referenced by pmfunc_alloc(), and pmfunc_free().

Here is the caller graph for this function:

◆ pmfuncs_free()

static void pmfuncs_free ( )
static

Definition at line 182 of file mtrace.h.

References i, p, pmfuncn, pmfuncs, and x.

Referenced by pmuntrace().

Here is the caller graph for this function:

◆ pmuntrace()

void pmuntrace ( void  )

Definition at line 192 of file mtrace.h.

References fname, i, p, pmaxsort(), pmfuncn, pmfuncs, pmfuncs_free(), pmtrace, ptotalsort(), s, and x.

Here is the call graph for this function:

◆ prealloc()

static void * prealloc ( void ptr,
size_t  size,
const char func,
const char file,
int  line 
)
static

Definition at line 149 of file mtrace.h.

References file, func, line, pmfunc_alloc(), pmfunc_free(), size, and x.

Here is the call graph for this function:

◆ pstrdup()

static char * pstrdup ( const char s,
const char func,
const char file,
int  line 
)
static

Definition at line 163 of file mtrace.h.

References d, file, func, line, pmalloc(), s, and x.

Here is the call graph for this function:

◆ ptotalsort()

static int ptotalsort ( const void a,
const void b 
)
static

Definition at line 177 of file mtrace.h.

References a, b, and x.

Referenced by pmuntrace().

Here is the caller graph for this function:

Variable Documentation

◆ fname

char* fname

Definition at line 12 of file mtrace.h.

Referenced by pmuntrace().

◆ fp

◆ max

◆ maxoverhead

size_t maxoverhead

Definition at line 9 of file mtrace.h.

◆ maxrss

size_t maxrss

Definition at line 11 of file mtrace.h.

◆ nr

◆ overhead

size_t overhead

Definition at line 9 of file mtrace.h.

◆ pmfuncn

int pmfuncn = 0
static

Definition at line 26 of file mtrace.h.

Referenced by pmfunc_free(), pmfunc_index(), pmfuncs_free(), and pmuntrace().

◆ pmfuncs

pmfunc* pmfuncs = NULL
static

Definition at line 25 of file mtrace.h.

Referenced by pmfunc_alloc(), pmfunc_free(), pmfunc_index(), pmfuncs_free(), and pmuntrace().

◆ [struct]

struct { ... } pmtrace

◆ startrss

size_t startrss

Definition at line 11 of file mtrace.h.

◆ total

size_t total

Definition at line 8 of file mtrace.h.