ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
mcd.c File Reference
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdarg.h>
#include "mcd.h"
#include <unistd.h>
#include <errno.h>
Include dependency graph for mcd.c:

Classes

struct  ChunkS
 

Macros

#define MCD_VERBOSE
 
#define MCD_FASTFREE
 
#define __USE_GNU
 
#define MCD_C_FILE_BUILD
 
#define CHUNK_MAGIC   0x1337C0DE
 
#define RTL   (RealTimeLog?RealTimeLog:stderr)
 
#define SOC   sizeof(Chunk)
 

Typedefs

typedef struct ChunkS Chunk
 

Functions

void addChunk (void *p, int size, char *fun, char *file, int line)
 
int delChunk (void *p)
 
void phex (FILE *f, long long v)
 
void * MCD_malloc (int size, char *fun, char *file, int line)
 
void * MCD_calloc (int size, char *fun, char *file, int line)
 
void * MCD_realloc (void *p, int size, char *fun, char *file, int line)
 
char * MCD_strdup (char *s, char *fun, char *file, int line)
 
char * MCD_strndup (char *s, int z, char *fun, char *file, int line)
 
void scan_args (const char *fmt, va_list argptr, char *fun, char *file, int line)
 
int MCD_scanf (const char *fmt, char *fun, char *file, int line,...)
 
int MCD_fscanf (FILE *stream, const char *fmt, char *fun, char *file, int line,...)
 
int MCD_sscanf (const char *str, const char *fmt, char *fun, char *file, int line,...)
 
void MCD_free (void *p, char *fun, char *file, int line)
 
void showMemStats ()
 
void _MCD_RealTimeLog (FILE *f)
 
void _MCD_MemStatLog (FILE *f)
 

Variables

ChunkMemoryChunks =NULL
 
ChunkLastChunk =NULL
 
int smallest =0
 
int largest =0
 
int maximum =0
 
int current =0
 
int totalAlloc =0
 
int totalFree =0
 
int peakAlloc =0
 
int totalOverflow =0
 
FILE * RealTimeLog =NULL
 
FILE * MemStatLog =NULL
 
long long idbase =0
 
char chunkLock =0
 

Macro Definition Documentation

◆ __USE_GNU

#define __USE_GNU

◆ CHUNK_MAGIC

#define CHUNK_MAGIC   0x1337C0DE

◆ MCD_C_FILE_BUILD

#define MCD_C_FILE_BUILD

◆ MCD_FASTFREE

#define MCD_FASTFREE

◆ MCD_VERBOSE

#define MCD_VERBOSE

◆ RTL

#define RTL   (RealTimeLog?RealTimeLog:stderr)

◆ SOC

#define SOC   sizeof(Chunk)

Typedef Documentation

◆ Chunk

typedef struct ChunkS Chunk

Function Documentation

◆ _MCD_MemStatLog()

void _MCD_MemStatLog ( FILE *  f)

◆ _MCD_RealTimeLog()

void _MCD_RealTimeLog ( FILE *  f)

◆ addChunk()

void addChunk ( void *  p,
int  size,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ delChunk()

int delChunk ( void *  p)
Here is the caller graph for this function:

◆ MCD_calloc()

void * MCD_calloc ( int  size,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:

◆ MCD_free()

void MCD_free ( void *  p,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:

◆ MCD_fscanf()

int MCD_fscanf ( FILE *  stream,
const char *  fmt,
char *  fun,
char *  file,
int  line,
  ... 
)
Here is the call graph for this function:

◆ MCD_malloc()

void * MCD_malloc ( int  size,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:

◆ MCD_realloc()

void * MCD_realloc ( void *  p,
int  size,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:

◆ MCD_scanf()

int MCD_scanf ( const char *  fmt,
char *  fun,
char *  file,
int  line,
  ... 
)
Here is the call graph for this function:

◆ MCD_sscanf()

int MCD_sscanf ( const char *  str,
const char *  fmt,
char *  fun,
char *  file,
int  line,
  ... 
)
Here is the call graph for this function:

◆ MCD_strdup()

char * MCD_strdup ( char *  s,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:

◆ MCD_strndup()

char * MCD_strndup ( char *  s,
int  z,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:

◆ phex()

void phex ( FILE *  f,
long long  v 
)
inline
Here is the caller graph for this function:

◆ scan_args()

void scan_args ( const char *  fmt,
va_list  argptr,
char *  fun,
char *  file,
int  line 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ showMemStats()

void showMemStats ( void  )
Here is the call graph for this function:

Variable Documentation

◆ chunkLock

char chunkLock =0

◆ current

int current =0

◆ idbase

long long idbase =0

◆ largest

int largest =0

◆ LastChunk

Chunk * LastChunk =NULL

◆ maximum

int maximum =0

◆ MemoryChunks

Chunk* MemoryChunks =NULL

◆ MemStatLog

FILE* MemStatLog =NULL

◆ peakAlloc

int peakAlloc =0

◆ RealTimeLog

FILE* RealTimeLog =NULL

◆ smallest

int smallest =0

◆ totalAlloc

int totalAlloc =0

◆ totalFree

int totalFree =0

◆ totalOverflow

int totalOverflow =0