SURFEX v8.1
General documentation of Surfex
Typedefs | Functions | Variables
getcurheap.c File Reference

Go to the source code of this file.

Typedefs

typedef long long int ll_t
 

Functions

int get_thread_id_ (void)
 
int get_proc_id_ (void)
 
int get_max_threads_ (void)
 
ll_t getstk_ ()
 
ll_t gethwm_ ()
 
void xl__trbk_ ()
 
void necsx_trbk_ (const char *msg, int msglen)
 
void necsx_trbk_fl_ (const char *msg, const char *filename, int *lineno, int msglen, int filenamelen)
 
static void Check_curalloc ()
 
static void Profile_heap_init ()
 
static void Profile_heap_put (ll_t size, int is_malloc)
 
static void Profile_heap_put_thrd (ll_t size, int is_malloc, int it)
 
void profile_heap_get (ll_t val[], const int *Nval, const int *Icase, int *nret)
 
void EC_free (void *vptr)
 
void * EC_malloc (ll_t size)
 
void * EC_calloc (ll_t nelem, ll_t elsize)
 
void * EC_realloc (void *vptr, ll_t size)
 
char * EC_strdup (const char *s)
 
ll_t getcurheap ()
 
ll_t getcurheap_thread (const int *thread_id)
 
ll_t getmaxcurheap ()
 
ll_t getmaxcurheap_thread (const int *thread_id)
 
ll_t getmaxloc ()
 
void resetmaxloc ()
 
void setheapcheck_ ()
 

Variables

int drhook_memtrace
 
static ll_t maxloc = 0
 
static ll_t begloc = 0
 
static int heapcheck = 0
 
pthread_mutex_t getcurheap_lock = PTHREAD_MUTEX_INITIALIZER
 
int EC_malloc_will_abort = 1
 
static ll_t maxcurheap = 0
 
static int profile_heap = -1
 
static ll_t malloc_hits [NPROFILE+1]
 
static ll_t free_hits [NPROFILE+1]
 
static ll_t alloc_amount [NPROFILE+1]
 
static ll_t malloc_hits_thrd [NTHRDS][NPROFILE+1]
 
static ll_t free_hits_thrd [NTHRDS][NPROFILE+1]
 
static ll_t alloc_amount_thrd [NTHRDS][NPROFILE+1]
 
static ll_t curalloc = 0
 
struct {
   ll_t   curalloca
 
   ll_t   maxcurheapa
 
   char   pad [CACHELINESIZE - 2 *WORDLEN]
 
clsz_opt [NTHRDS]
 
static int nans_fill = -1
 
static int free_error = 0
 
static int max_free_error = 10
 
static double disclaim_threshold = 2048
 
static ll_t disclaim_threshold_test = 0
 
static ll_t disclaim_threshold_limit = 2147483647
 

Typedef Documentation

◆ ll_t

typedef long long int ll_t

Definition at line 14 of file getcurheap.c.

Function Documentation

◆ Check_curalloc()

static void Check_curalloc ( )
static

Definition at line 173 of file getcurheap.c.

Here is the call graph for this function:

◆ EC_calloc()

void* EC_calloc ( ll_t  nelem,
ll_t  elsize 
)

Definition at line 490 of file getcurheap.c.

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

◆ EC_free()

void EC_free ( void *  vptr)

Definition at line 315 of file getcurheap.c.

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

◆ EC_malloc()

void* EC_malloc ( ll_t  size)

Definition at line 366 of file getcurheap.c.

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

◆ EC_realloc()

void* EC_realloc ( void *  vptr,
ll_t  size 
)

Definition at line 498 of file getcurheap.c.

Here is the call graph for this function:

◆ EC_strdup()

char* EC_strdup ( const char *  s)

Definition at line 521 of file getcurheap.c.

Here is the call graph for this function:

◆ get_max_threads_()

int get_max_threads_ ( void  )
Here is the caller graph for this function:

◆ get_proc_id_()

int get_proc_id_ ( void  )
Here is the caller graph for this function:

◆ get_thread_id_()

int get_thread_id_ ( void  )
Here is the caller graph for this function:

◆ getcurheap()

ll_t getcurheap ( )

Definition at line 530 of file getcurheap.c.

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

◆ getcurheap_thread()

ll_t getcurheap_thread ( const int *  thread_id)

Definition at line 555 of file getcurheap.c.

Here is the call graph for this function:

◆ gethwm_()

ll_t gethwm_ ( )
Here is the caller graph for this function:

◆ getmaxcurheap()

ll_t getmaxcurheap ( )

Definition at line 568 of file getcurheap.c.

Here is the call graph for this function:

◆ getmaxcurheap_thread()

ll_t getmaxcurheap_thread ( const int *  thread_id)

Definition at line 588 of file getcurheap.c.

Here is the call graph for this function:

◆ getmaxloc()

ll_t getmaxloc ( )

Definition at line 600 of file getcurheap.c.

◆ getstk_()

ll_t getstk_ ( )

Definition at line 24 of file getstk.c.

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

◆ necsx_trbk_()

void necsx_trbk_ ( const char *  msg,
int  msglen 
)

◆ necsx_trbk_fl_()

void necsx_trbk_fl_ ( const char *  msg,
const char *  filename,
int *  lineno,
int  msglen,
int  filenamelen 
)

◆ profile_heap_get()

void profile_heap_get ( ll_t  val[],
const int *  Nval,
const int *  Icase,
int *  nret 
)

Definition at line 260 of file getcurheap.c.

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

◆ Profile_heap_init()

static void Profile_heap_init ( )
static

Definition at line 186 of file getcurheap.c.

Here is the caller graph for this function:

◆ Profile_heap_put()

static void Profile_heap_put ( ll_t  size,
int  is_malloc 
)
static

Definition at line 212 of file getcurheap.c.

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

◆ Profile_heap_put_thrd()

static void Profile_heap_put_thrd ( ll_t  size,
int  is_malloc,
int  it 
)
static

Definition at line 235 of file getcurheap.c.

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

◆ resetmaxloc()

void resetmaxloc ( )

Definition at line 607 of file getcurheap.c.

◆ setheapcheck_()

void setheapcheck_ ( )

Definition at line 614 of file getcurheap.c.

◆ xl__trbk_()

void xl__trbk_ ( )
Here is the caller graph for this function:

Variable Documentation

◆ alloc_amount

ll_t alloc_amount[NPROFILE+1]
static

Definition at line 115 of file getcurheap.c.

◆ alloc_amount_thrd

ll_t alloc_amount_thrd[NTHRDS][NPROFILE+1]
static

Definition at line 118 of file getcurheap.c.

◆ begloc

ll_t begloc = 0
static

Definition at line 49 of file getcurheap.c.

◆ clsz_opt

struct { ... } clsz_opt[NTHRDS]

◆ curalloc

ll_t curalloc = 0
static

Definition at line 120 of file getcurheap.c.

◆ curalloca

ll_t curalloca

Definition at line 123 of file getcurheap.c.

◆ disclaim_threshold

double disclaim_threshold = 2048
static

Definition at line 165 of file getcurheap.c.

◆ disclaim_threshold_limit

ll_t disclaim_threshold_limit = 2147483647
static

Definition at line 167 of file getcurheap.c.

◆ disclaim_threshold_test

ll_t disclaim_threshold_test = 0
static

Definition at line 166 of file getcurheap.c.

◆ drhook_memtrace

int drhook_memtrace

Definition at line 79 of file drhook.c.

◆ EC_malloc_will_abort

int EC_malloc_will_abort = 1

Definition at line 88 of file getcurheap.c.

◆ free_error

int free_error = 0
static

Definition at line 130 of file getcurheap.c.

◆ free_hits

ll_t free_hits[NPROFILE+1]
static

Definition at line 114 of file getcurheap.c.

◆ free_hits_thrd

ll_t free_hits_thrd[NTHRDS][NPROFILE+1]
static

Definition at line 117 of file getcurheap.c.

◆ getcurheap_lock

pthread_mutex_t getcurheap_lock = PTHREAD_MUTEX_INITIALIZER

Definition at line 79 of file getcurheap.c.

◆ heapcheck

int heapcheck = 0
static

Definition at line 50 of file getcurheap.c.

◆ malloc_hits

ll_t malloc_hits[NPROFILE+1]
static

Definition at line 113 of file getcurheap.c.

◆ malloc_hits_thrd

ll_t malloc_hits_thrd[NTHRDS][NPROFILE+1]
static

Definition at line 116 of file getcurheap.c.

◆ max_free_error

int max_free_error = 10
static

Definition at line 131 of file getcurheap.c.

◆ maxcurheap

ll_t maxcurheap = 0
static

Definition at line 107 of file getcurheap.c.

◆ maxcurheapa

ll_t maxcurheapa

Definition at line 124 of file getcurheap.c.

◆ maxloc

ll_t maxloc = 0
static

Definition at line 48 of file getcurheap.c.

◆ nans_fill

int nans_fill = -1
static

Definition at line 129 of file getcurheap.c.

◆ pad

char pad[CACHELINESIZE - 2 *WORDLEN]

Definition at line 125 of file getcurheap.c.

◆ profile_heap

int profile_heap = -1
static

Definition at line 111 of file getcurheap.c.