BOSS 7.1.1
BESIII Offline Software System
|
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | MW_ARI_NULLREAD 0x10 /* Null read (to start debugger) */ |
#define | MW_ARI_ABORT 0x04 /* ARI handler says: abort program! */ |
#define | MW_ARI_RETRY 0x02 /* ARI handler says: retry action! */ |
#define | MW_ARI_IGNORE 0x01 /* ARI handler says: ignore error! */ |
#define | MW_VAL_NEW 0xFE /* value in newly allocated memory */ |
#define | MW_VAL_DEL 0xFD /* value in newly deleted memory */ |
#define | MW_VAL_NML 0xFC /* value in no-mans-land */ |
#define | MW_VAL_GRB 0xFB /* value in grabbed memory */ |
#define | MW_TEST_ALL 0xFFFF /* perform all tests */ |
#define | MW_TEST_CHAIN 0x0001 /* walk the heap chain */ |
#define | MW_TEST_ALLOC 0x0002 /* test allocations & NML guards */ |
#define | MW_TEST_NML 0x0004 /* test all-NML areas for modifications */ |
#define | MW_NML_NONE 0 /* no NML */ |
#define | MW_NML_FREE 1 /* turn FREE'd memory into NML */ |
#define | MW_NML_ALL 2 /* all unused memory is NML */ |
#define | MW_NML_DEFAULT 0 /* the default NML setting */ |
#define | MW_STAT_GLOBAL 0 /* only global statistics collected */ |
#define | MW_STAT_MODULE 1 /* collect statistics on a module basis */ |
#define | MW_STAT_LINE 2 /* collect statistics on a line basis */ |
#define | MW_STAT_DEFAULT 0 /* the default statistics setting */ |
#define | MW_TRACE_BUFFER 2048 /* (min 160) size of TRACE()'s output buffer */ |
#define | MW_FREE_LIST 64 /* (min 4) number of free()'s to track */ |
#define | mwASSERT(exp) |
#define | ASSERT mwASSERT |
#define | mwVERIFY(exp) |
#define | VERIFY mwVERIFY |
#define | mwTRACE /*lint -save -e506 */ 1?(void)0:mwDummyTraceFunction /*lint -restore */ |
#define | TRACE mwTRACE |
#define | mwDoFlush(n) |
#define | mwPuts(s) |
#define | mwInit() |
#define | mwGrab(n) |
#define | mwDrop(n) |
#define | mwLimit(n) |
#define | mwTest(f, l) |
#define | mwSetOutFunc(f) |
#define | mwSetAriFunc(f) |
#define | mwDefaultAri() |
#define | mwNomansland() |
#define | mwStatistics(f) |
#define | mwMark(p, t, f, n) |
#define | mwUnmark(p, f, n) |
#define | mwMalloc(n, f, l) |
#define | mwStrdup(p, f, l) |
#define | mwRealloc(p, n, f, l) |
#define | mwCalloc(n, m, f, l) |
#define | mwFree(p) |
#define | mwMalloc_(n) |
#define | mwRealloc_(p, n) |
#define | mwCalloc_(n, m) |
#define | mwFree_(p) |
#define | mwAssert(e, es, f, l) |
#define | mwVerify(e, es, f, l) |
#define | mwTrace mwDummyTrace |
#define | mwTestBuffer(f, l, b) |
#define | CHECK() |
#define | CHECK_THIS(n) |
#define | CHECK_BUFFER(b) |
#define | MARK(p) |
#define | UNMARK(p) |
Functions | |
void | mwTerm (void) |
void | mwAbort (void) |
void | mwFlushNow (void) |
void | mwDoFlush (int onoff) |
void | mwLimit (long bytes) |
unsigned | mwGrab (unsigned kilobytes) |
unsigned | mwDrop (unsigned kilobytes) |
void | mwNoMansLand (int mw_nml_level) |
void | mwStatistics (int level) |
void | mwFreeBufferInfo (int onoff) |
void | mwAutoCheck (int onoff) |
void | mwCalcCheck (void) |
void | mwDumpCheck (void) |
void * | mwMark (void *p, const char *description, const char *file, unsigned line) |
void * | mwUnmark (void *p, const char *file, unsigned line) |
int | mwIsReadAddr (const void *p, unsigned len) |
int | mwIsSafeAddr (void *p, unsigned len) |
int | mwTest (const char *file, int line, int mw_test_flags) |
int | mwTestBuffer (const char *file, int line, void *p) |
int | mwAssert (int, const char *, const char *, int) |
int | mwVerify (int, const char *, const char *, int) |
void | mwTrace (const char *format_string,...) |
void | mwPuts (const char *text) |
void | mwSetOutFunc (void(*func)(int)) |
void | mwSetAriFunc (int(*func)(const char *)) |
void | mwSetAriAction (int mw_ari_value) |
int | mwAriHandler (const char *cause) |
void | mwBreakOut (const char *cause) |
void * | mwMalloc (size_t, const char *, int) |
void * | mwMalloc_ (size_t) |
void * | mwRealloc (void *, size_t, const char *, int) |
void * | mwRealloc_ (void *, size_t) |
void * | mwCalloc (size_t, size_t, const char *, int) |
void * | mwCalloc_ (size_t, size_t) |
void | mwFree (void *, const char *, int) |
void | mwFree_ (void *) |
char * | mwStrdup (const char *, const char *, int) |
void | mwDummyTraceFunction (const char *,...) |
Variables | |
const unsigned long | mwCounter |
#define ASSERT mwASSERT |
Definition at line 594 of file KalFitMemLeak.h.
#define CHECK | ( | ) |
Definition at line 643 of file KalFitMemLeak.h.
#define CHECK_BUFFER | ( | b | ) |
Definition at line 645 of file KalFitMemLeak.h.
#define CHECK_THIS | ( | n | ) |
Definition at line 644 of file KalFitMemLeak.h.
#define MARK | ( | p | ) |
Definition at line 646 of file KalFitMemLeak.h.
#define MW_ARI_ABORT 0x04 /* ARI handler says: abort program! */ |
Definition at line 349 of file KalFitMemLeak.h.
#define MW_ARI_IGNORE 0x01 /* ARI handler says: ignore error! */ |
Definition at line 351 of file KalFitMemLeak.h.
Referenced by mwAssert(), and mwVerify().
#define MW_ARI_NULLREAD 0x10 /* Null read (to start debugger) */ |
Definition at line 348 of file KalFitMemLeak.h.
Referenced by mwAssert(), and mwVerify().
#define MW_ARI_RETRY 0x02 /* ARI handler says: retry action! */ |
Definition at line 350 of file KalFitMemLeak.h.
Referenced by mwAssert().
Definition at line 379 of file KalFitMemLeak.h.
Referenced by mwFree(), and mwRealloc().
#define MW_NML_ALL 2 /* all unused memory is NML */ |
Definition at line 365 of file KalFitMemLeak.h.
Referenced by mwNoMansLand().
#define MW_NML_DEFAULT 0 /* the default NML setting */ |
Definition at line 366 of file KalFitMemLeak.h.
#define MW_NML_FREE 1 /* turn FREE'd memory into NML */ |
Definition at line 364 of file KalFitMemLeak.h.
Referenced by mwNoMansLand().
#define MW_NML_NONE 0 /* no NML */ |
Definition at line 363 of file KalFitMemLeak.h.
Referenced by mwNoMansLand().
#define MW_STAT_DEFAULT 0 /* the default statistics setting */ |
Definition at line 371 of file KalFitMemLeak.h.
#define MW_STAT_GLOBAL 0 /* only global statistics collected */ |
Definition at line 368 of file KalFitMemLeak.h.
#define MW_STAT_LINE 2 /* collect statistics on a line basis */ |
Definition at line 370 of file KalFitMemLeak.h.
#define MW_STAT_MODULE 1 /* collect statistics on a module basis */ |
Definition at line 369 of file KalFitMemLeak.h.
#define MW_TEST_ALL 0xFFFF /* perform all tests */ |
Definition at line 358 of file KalFitMemLeak.h.
Referenced by mwAutoCheck().
#define MW_TEST_ALLOC 0x0002 /* test allocations & NML guards */ |
Definition at line 360 of file KalFitMemLeak.h.
#define MW_TEST_CHAIN 0x0001 /* walk the heap chain */ |
Definition at line 359 of file KalFitMemLeak.h.
Definition at line 361 of file KalFitMemLeak.h.
Definition at line 378 of file KalFitMemLeak.h.
Referenced by mwAssert(), mwTrace(), and mwVerify().
#define MW_VAL_DEL 0xFD /* value in newly deleted memory */ |
Definition at line 354 of file KalFitMemLeak.h.
Referenced by mwFree().
#define MW_VAL_GRB 0xFB /* value in grabbed memory */ |
Definition at line 356 of file KalFitMemLeak.h.
#define MW_VAL_NEW 0xFE /* value in newly allocated memory */ |
Definition at line 353 of file KalFitMemLeak.h.
Referenced by mwMalloc().
#define MW_VAL_NML 0xFC /* value in no-mans-land */ |
Definition at line 355 of file KalFitMemLeak.h.
Referenced by mwAbort(), mwFree(), mwNoMansLand(), and mwRealloc().
#define mwASSERT | ( | exp | ) |
Definition at line 591 of file KalFitMemLeak.h.
#define mwAssert | ( | e, | |
es, | |||
f, | |||
l ) |
Definition at line 639 of file KalFitMemLeak.h.
Definition at line 633 of file KalFitMemLeak.h.
#define mwCalloc_ | ( | n, | |
m ) |
Definition at line 637 of file KalFitMemLeak.h.
#define mwDefaultAri | ( | ) |
Definition at line 625 of file KalFitMemLeak.h.
#define mwDoFlush | ( | n | ) |
Definition at line 616 of file KalFitMemLeak.h.
#define mwDrop | ( | n | ) |
Definition at line 620 of file KalFitMemLeak.h.
#define mwFree | ( | p | ) |
#define mwFree_ | ( | p | ) |
#define mwGrab | ( | n | ) |
Definition at line 619 of file KalFitMemLeak.h.
void mwInit | ( | ) |
Definition at line 618 of file KalFitMemLeak.h.
#define mwLimit | ( | n | ) |
Definition at line 621 of file KalFitMemLeak.h.
Definition at line 630 of file KalFitMemLeak.h.
Referenced by mwCalloc(), mwRealloc(), and mwStrdup().
#define mwMalloc_ | ( | n | ) |
Definition at line 635 of file KalFitMemLeak.h.
Definition at line 628 of file KalFitMemLeak.h.
#define mwNomansland | ( | ) |
Definition at line 626 of file KalFitMemLeak.h.
#define mwPuts | ( | s | ) |
Definition at line 617 of file KalFitMemLeak.h.
Definition at line 632 of file KalFitMemLeak.h.
#define mwRealloc_ | ( | p, | |
n ) |
Definition at line 636 of file KalFitMemLeak.h.
#define mwSetAriFunc | ( | f | ) |
Definition at line 624 of file KalFitMemLeak.h.
#define mwSetOutFunc | ( | f | ) |
Definition at line 623 of file KalFitMemLeak.h.
#define mwStatistics | ( | f | ) |
Definition at line 627 of file KalFitMemLeak.h.
#define mwStrdup | ( | p, | |
f, | |||
l ) |
Definition at line 631 of file KalFitMemLeak.h.
#define mwTest | ( | f, | |
l ) |
Definition at line 622 of file KalFitMemLeak.h.
Definition at line 642 of file KalFitMemLeak.h.
#define mwTRACE /*lint -save -e506 */ 1?(void)0:mwDummyTraceFunction /*lint -restore */ |
Definition at line 606 of file KalFitMemLeak.h.
#define mwTrace mwDummyTrace |
Definition at line 641 of file KalFitMemLeak.h.
Definition at line 629 of file KalFitMemLeak.h.
#define mwVERIFY | ( | exp | ) |
Definition at line 598 of file KalFitMemLeak.h.
#define mwVerify | ( | e, | |
es, | |||
f, | |||
l ) |
Definition at line 640 of file KalFitMemLeak.h.
#define TRACE mwTRACE |
Definition at line 610 of file KalFitMemLeak.h.
#define UNMARK | ( | p | ) |
Definition at line 647 of file KalFitMemLeak.h.
#define VERIFY mwVERIFY |
Definition at line 601 of file KalFitMemLeak.h.
void mwAbort | ( | void | ) |
Definition at line 517 of file KalFitMemLeak.c.
int mwAriHandler | ( | const char * | cause | ) |
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 mwCalcCheck | ( | void | ) |
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 | kilobytes | ) |
Definition at line 1377 of file KalFitMemLeak.c.
|
extern |
void mwDumpCheck | ( | void | ) |
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.
void mwFreeBufferInfo | ( | int | onoff | ) |
unsigned mwGrab | ( | unsigned | kilobytes | ) |
Definition at line 1372 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 | bytes | ) |
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 * | description, | ||
const char * | file, | ||
unsigned | line ) |
Definition at line 718 of file KalFitMemLeak.c.
void mwNoMansLand | ( | int | mw_nml_level | ) |
Definition at line 1489 of file KalFitMemLeak.c.
void mwPuts | ( | const char * | text | ) |
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 | mw_ari_value | ) |
Definition at line 1220 of file KalFitMemLeak.c.
void mwSetAriFunc | ( | int(* | func )(const char *) | ) |
Definition at line 854 of file KalFitMemLeak.c.
void mwSetOutFunc | ( | void(* | func )(int) | ) |
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 | mw_test_flags ) |
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_string, |
... ) |
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.
|
extern |
Referenced by mwAssert(), mwFree(), mwMalloc(), mwRealloc(), mwStrdup(), and mwVerify().