PIPS
malloc_debug.c File Reference
#include "genC.h"
#include "misc.h"
+ Include dependency graph for malloc_debug.c:

Go to the source code of this file.

Functions

void pips_malloc_debug ()
 include <sys/stdtypes.h> More...
 

Function Documentation

◆ pips_malloc_debug()

void pips_malloc_debug ( void  )

include <sys/stdtypes.h>

malloc_debug.c

include "stdlib.h"

Definition at line 34 of file malloc_debug.c.

35 {
36  debug_on("MALLOC_DEBUG_LEVEL");
37 #if __GNUC__foo || sunfoo
38  if (get_debug_level()==9) {
39  debug(9, "pips_malloc_debug",
40  "malloc_debug level of error diagnosis is 2\n");
41  malloc_debug(2);
42  }
43  else if (get_debug_level()>=5) {
44  debug(5, "pips_malloc_debug", "malloc(50) returns %x\n",
45  (int) malloc(50));
46  debug(5, "pips_malloc_debug", "call to malloc_verify()\n");
47  pips_assert("pips_malloc_debug", malloc_verify());
48  malloc_debug(1);
49  }
50  else if (get_debug_level()>=1)
51  malloc_debug(1);
52  else
53  malloc_debug(0);
54 #else
55  debug(1, "pips_malloc_debug", "No malloc_debug on this system\n");
56 #endif
57  debug_off();
58 }
void * malloc(YYSIZE_T)
#define debug_on(env)
Definition: misc-local.h:157
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define debug_off()
Definition: misc-local.h:160
int get_debug_level(void)
GET_DEBUG_LEVEL returns the current debugging level.
Definition: debug.c:67
void debug(const int the_expected_debug_level, const char *calling_function_name, const char *a_message_format,...)
ARARGS0.
Definition: debug.c:189

References debug(), debug_off, debug_on, get_debug_level(), malloc(), and pips_assert.

Referenced by apply_a_rule(), and safe_do_something().

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