BOSS 7.0.5
BESIII Offline Software System
|
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <setjmp.h>
#include <time.h>
#include <limits.h>
#include "memwatch.h"
#include <ctype.h>
Go to the source code of this file.
Classes | |
struct | mwData_ |
struct | mwStat_ |
struct | mwGrabData_ |
struct | mwMarker_ |
Macros | |
#define | __MEMWATCH_C 1 |
#define | VERSION "2.71" /* the current version number */ |
#define | CHKVAL(mw) (0xFE0180L^(long)mw->count^(long)mw->size^(long)mw->line) |
#define | FLUSH() mwFlush() |
#define | TESTS(f, l) if(mwTestAlways) (void)mwTestNow(f,l,1) |
#define | PRECHK 0x01234567L |
#define | POSTCHK 0x76543210L |
#define | mwBUFFER_TO_MW(p) ( (mwData*) (void*) ( ((char*)p)-mwDataSize-mwOverflowZoneSize ) ) |
#define | MW_NML 0x0001 |
#define | COMMIT "" /* Normal ANSI */ |
#define | CPPTEXT "" |
#define | mwSTDERR mwLog |
#define | MW_MUTEX_INIT() |
#define | MW_MUTEX_TERM() |
#define | MW_MUTEX_LOCK() |
#define | MW_MUTEX_UNLOCK() |
#define | mw16BIT 1 |
#define | mwROUNDALLOC_DEFAULT 2 |
#define | mwROUNDALLOC mwROUNDALLOC_DEFAULT |
#define | AIPH() if( always_invoked ) { mwWrite("autocheck: <%ld> %s(%d) ", mwCounter, file, line ); always_invoked = 0; } |
Typedefs | |
typedef struct mwData_ | mwData |
typedef struct mwStat_ | mwStat |
typedef struct mwGrabData_ | mwGrabData |
typedef struct mwMarker_ | mwMarker |
Functions | |
void | mwInit (void) |
void | mwAbort (void) |
void | mwTerm (void) |
void | mwStatistics (int level) |
void | mwAutoCheck (int onoff) |
void | mwSetOutFunc (void(*func)(int)) |
int | mwTest (const char *file, int line, int items) |
int | mwTestBuffer (const char *file, int line, void *p) |
void | mwBreakOut (const char *cause) |
void * | mwMark (void *p, const char *desc, const char *file, unsigned line) |
void * | mwUnmark (void *p, const char *file, unsigned line) |
int | mwAriHandler (const char *estr) |
void | mwSetAriFunc (int(*func)(const char *)) |
void * | mwMalloc (size_t size, const char *file, int line) |
void * | mwRealloc (void *p, size_t size, const char *file, int line) |
char * | mwStrdup (const char *str, const char *file, int line) |
void | mwFree (void *p, const char *file, int line) |
void * | mwCalloc (size_t a, size_t b, const char *file, int line) |
void | mwFree_ (void *p) |
void * | mwMalloc_ (size_t size) |
void * | mwRealloc_ (void *p, size_t size) |
void * | mwCalloc_ (size_t a, size_t b) |
void | mwFlushNow (void) |
void | mwDoFlush (int onoff) |
void | mwLimit (long lim) |
void | mwSetAriAction (int action) |
int | mwAssert (int exp, const char *exps, const char *fn, int ln) |
int | mwVerify (int exp, const char *exps, const char *fn, int ln) |
void | mwTrace (const char *format,...) |
unsigned | mwGrab (unsigned kb) |
unsigned | mwDrop (unsigned kb) |
void | mwNoMansLand (int level) |
int | mwIsReadAddr (const void *p, unsigned len) |
int | mwIsSafeAddr (void *p, unsigned len) |
#define __MEMWATCH_C 1 |
Definition at line 97 of file KalFitMemLeak.c.
#define AIPH | ( | ) | if( always_invoked ) { mwWrite("autocheck: <%ld> %s(%d) ", mwCounter, file, line ); always_invoked = 0; } |
Definition at line 2152 of file KalFitMemLeak.c.
#define CHKVAL | ( | mw | ) | (0xFE0180L^(long)mw->count^(long)mw->size^(long)mw->line) |
Definition at line 140 of file KalFitMemLeak.c.
#define COMMIT "" /* Normal ANSI */ |
Definition at line 153 of file KalFitMemLeak.c.
#define CPPTEXT "" |
Definition at line 159 of file KalFitMemLeak.c.
#define FLUSH | ( | ) | mwFlush() |
Definition at line 141 of file KalFitMemLeak.c.
#define mw16BIT 1 |
Definition at line 199 of file KalFitMemLeak.c.
#define MW_MUTEX_INIT | ( | ) |
Definition at line 174 of file KalFitMemLeak.c.
#define MW_MUTEX_LOCK | ( | ) |
Definition at line 176 of file KalFitMemLeak.c.
#define MW_MUTEX_TERM | ( | ) |
Definition at line 175 of file KalFitMemLeak.c.
#define MW_MUTEX_UNLOCK | ( | ) |
Definition at line 177 of file KalFitMemLeak.c.
#define MW_NML 0x0001 |
Definition at line 148 of file KalFitMemLeak.c.
#define mwBUFFER_TO_MW | ( | p | ) | ( (mwData*) (void*) ( ((char*)p)-mwDataSize-mwOverflowZoneSize ) ) |
Definition at line 145 of file KalFitMemLeak.c.
#define mwROUNDALLOC mwROUNDALLOC_DEFAULT |
Definition at line 217 of file KalFitMemLeak.c.
#define mwROUNDALLOC_DEFAULT 2 |
Definition at line 200 of file KalFitMemLeak.c.
#define mwSTDERR mwLog |
Definition at line 165 of file KalFitMemLeak.c.
#define POSTCHK 0x76543210L |
Definition at line 144 of file KalFitMemLeak.c.
#define PRECHK 0x01234567L |
Definition at line 143 of file KalFitMemLeak.c.
Definition at line 142 of file KalFitMemLeak.c.
#define VERSION "2.71" /* the current version number */ |
Definition at line 139 of file KalFitMemLeak.c.
Definition at line 254 of file KalFitMemLeak.c.
typedef struct mwGrabData_ mwGrabData |
Definition at line 282 of file KalFitMemLeak.c.
Definition at line 289 of file KalFitMemLeak.c.
Definition at line 270 of file KalFitMemLeak.c.
void mwAbort | ( | void | ) |
Definition at line 517 of file KalFitMemLeak.c.
int mwAriHandler | ( | const char * | estr | ) |
Definition at line 848 of file KalFitMemLeak.c.
int mwAssert | ( | int | exp, |
const char * | exps, | ||
const char * | fn, | ||
int | ln | ||
) |
Definition at line 1228 of file KalFitMemLeak.c.
void mwAutoCheck | ( | int | onoff | ) |
Definition at line 649 of file KalFitMemLeak.c.
void mwBreakOut | ( | const char * | cause | ) |
Definition at line 709 of file KalFitMemLeak.c.
void * mwCalloc | ( | size_t | a, |
size_t | b, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 1154 of file KalFitMemLeak.c.
void * mwCalloc_ | ( | size_t | a, |
size_t | b | ||
) |
Definition at line 1184 of file KalFitMemLeak.c.
void mwDoFlush | ( | int | onoff | ) |
Definition at line 1196 of file KalFitMemLeak.c.
unsigned mwDrop | ( | unsigned | kb | ) |
Definition at line 1377 of file KalFitMemLeak.c.
void mwFlushNow | ( | void | ) |
Definition at line 1191 of file KalFitMemLeak.c.
void mwFree | ( | void * | p, |
const char * | file, | ||
int | line | ||
) |
Definition at line 1051 of file KalFitMemLeak.c.
void mwFree_ | ( | void * | p | ) |
Definition at line 1163 of file KalFitMemLeak.c.
unsigned mwGrab | ( | unsigned | kb | ) |
Definition at line 1372 of file KalFitMemLeak.c.
void mwInit | ( | void | ) |
Definition at line 413 of file KalFitMemLeak.c.
int mwIsReadAddr | ( | const void * | p, |
unsigned | len | ||
) |
Definition at line 2491 of file KalFitMemLeak.c.
Referenced by mwMark().
int mwIsSafeAddr | ( | void * | p, |
unsigned | len | ||
) |
Definition at line 2497 of file KalFitMemLeak.c.
void mwLimit | ( | long | lim | ) |
Definition at line 1202 of file KalFitMemLeak.c.
void * mwMalloc | ( | size_t | size, |
const char * | file, | ||
int | line | ||
) |
Definition at line 863 of file KalFitMemLeak.c.
void * mwMalloc_ | ( | size_t | size | ) |
Definition at line 1170 of file KalFitMemLeak.c.
void * mwMark | ( | void * | p, |
const char * | desc, | ||
const char * | file, | ||
unsigned | line | ||
) |
Definition at line 718 of file KalFitMemLeak.c.
void mwNoMansLand | ( | int | level | ) |
Definition at line 1489 of file KalFitMemLeak.c.
void * mwRealloc | ( | void * | p, |
size_t | size, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 947 of file KalFitMemLeak.c.
void * mwRealloc_ | ( | void * | p, |
size_t | size | ||
) |
Definition at line 1177 of file KalFitMemLeak.c.
void mwSetAriAction | ( | int | action | ) |
Definition at line 1220 of file KalFitMemLeak.c.
void mwSetAriFunc | ( | int(*)(const char *) | func | ) |
Definition at line 854 of file KalFitMemLeak.c.
void mwSetOutFunc | ( | void(*)(int) | func | ) |
Definition at line 655 of file KalFitMemLeak.c.
void mwStatistics | ( | int | level | ) |
Definition at line 637 of file KalFitMemLeak.c.
char * mwStrdup | ( | const char * | str, |
const char * | file, | ||
int | line | ||
) |
Definition at line 1029 of file KalFitMemLeak.c.
void mwTerm | ( | void | ) |
Definition at line 625 of file KalFitMemLeak.c.
int mwTest | ( | const char * | file, |
int | line, | ||
int | items | ||
) |
Definition at line 685 of file KalFitMemLeak.c.
int mwTestBuffer | ( | const char * | file, |
int | line, | ||
void * | p | ||
) |
Definition at line 695 of file KalFitMemLeak.c.
void mwTrace | ( | const char * | format, |
... | |||
) |
Definition at line 1343 of file KalFitMemLeak.c.
void * mwUnmark | ( | void * | p, |
const char * | file, | ||
unsigned | line | ||
) |
int mwVerify | ( | int | exp, |
const char * | exps, | ||
const char * | fn, | ||
int | ln | ||
) |
Definition at line 1287 of file KalFitMemLeak.c.