|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
#include <stdio.h>#include <string.h>#include <malloc.h>#include <stdarg.h>#include "mcd.h"#include <unistd.h>#include <errno.h>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 | |
| Chunk * | MemoryChunks =NULL |
| Chunk * | LastChunk =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 |
| #define __USE_GNU |
| #define CHUNK_MAGIC 0x1337C0DE |
| #define MCD_C_FILE_BUILD |
| #define MCD_FASTFREE |
| #define MCD_VERBOSE |
| #define RTL (RealTimeLog?RealTimeLog:stderr) |
| #define SOC sizeof(Chunk) |
| void _MCD_MemStatLog | ( | FILE * | f | ) |
| void _MCD_RealTimeLog | ( | FILE * | f | ) |
| void addChunk | ( | void * | p, |
| int | size, | ||
| char * | fun, | ||
| char * | file, | ||
| int | line | ||
| ) |
| int delChunk | ( | void * | p | ) |
| void * MCD_calloc | ( | int | size, |
| char * | fun, | ||
| char * | file, | ||
| int | line | ||
| ) |
| void MCD_free | ( | void * | p, |
| char * | fun, | ||
| char * | file, | ||
| int | line | ||
| ) |
| int MCD_fscanf | ( | FILE * | stream, |
| const char * | fmt, | ||
| char * | fun, | ||
| char * | file, | ||
| int | line, | ||
| ... | |||
| ) |
| void * MCD_malloc | ( | int | size, |
| char * | fun, | ||
| char * | file, | ||
| int | line | ||
| ) |
| void * MCD_realloc | ( | void * | p, |
| int | size, | ||
| char * | fun, | ||
| char * | file, | ||
| int | line | ||
| ) |
| int MCD_scanf | ( | const char * | fmt, |
| char * | fun, | ||
| char * | file, | ||
| int | line, | ||
| ... | |||
| ) |
| int MCD_sscanf | ( | const char * | str, |
| const char * | fmt, | ||
| 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 | ||
| ) |
|
inline |
| void scan_args | ( | const char * | fmt, |
| va_list | argptr, | ||
| char * | fun, | ||
| char * | file, | ||
| int | line | ||
| ) |
| void showMemStats | ( | void | ) |
| char chunkLock =0 |
| int current =0 |
| long long idbase =0 |
| int largest =0 |
| Chunk * LastChunk =NULL |
| int maximum =0 |
| Chunk* MemoryChunks =NULL |
| FILE* MemStatLog =NULL |
| int peakAlloc =0 |
| FILE* RealTimeLog =NULL |
| int smallest =0 |
| int totalAlloc =0 |
| int totalFree =0 |
| int totalOverflow =0 |