PPL Logo

conv-core/memory-paranoid.c File Reference

Go to the source code of this file.

Data Structures

struct  _Slot
 Struct Slot contains all of the information about a malloc buffer except for the contents of its memory. More...

Typedefs

typedef struct _Slot Slot

Functions

static void memAbort (const char *err, void *ptr)
static void setPad (char *pad)
static void fill_uninit (char *loc, int len)
static char * Slot_toUser (Slot *s)
static void slotAbort (const char *why, Slot *s)
static void checkPad (char *pad, char *errMsg, void *ptr, Slot *s)
static int badPointer (Slot *p)
static void checkSlot (Slot *s)
void memory_check (void)
void CmiMemoryMark (void)
void CmiMemoryMarkBlock (void *blk)
void CmiMemorySweep (const char *where)
void CmiMemoryCheck (void)
static void * setSlot (Slot *s, int userSize)
static void freeSlot (Slot *s)
static SlotSlot_fmUser (void *user)
static int meta_getpagesize (void)
static void status (char *msg)
static void meta_init (char **argv)
static void * meta_malloc (size_t size)
static void meta_free (void *mem)
static void * meta_calloc (size_t nelem, size_t size)
static void meta_cfree (void *mem)
static void * meta_realloc (void *oldBuffer, size_t newSize)
static void * meta_memalign (size_t align, size_t size)
static void * meta_valloc (size_t size)

Variables

static size_t max_allocated = 0
static int memory_fill = -1
static int memory_fillphase = 0
static Slot slot_first = {&slot_first,&slot_first}
static int memory_checkfreq = 100
static int memory_checkphase = 0
static int memory_verbose = 0
static int memoryTraceDisabled = 0


Typedef Documentation

typedef struct _Slot Slot

Definition at line 63 of file memory-paranoid.c.


Function Documentation

static void memAbort ( const char *  err,
void *  ptr 
) [static]

Definition at line 17 of file memory-paranoid.c.

References abort(), CmiAbort(), CmiMyPe(), and CmiPrintf().

Referenced by meta_free(), and slotAbort().

static void setPad ( char *  pad  )  [static]

Definition at line 68 of file memory-paranoid.c.

Referenced by setSlot().

static void fill_uninit ( char *  loc,
int  len 
) [static]

Definition at line 77 of file memory-paranoid.c.

Referenced by freeSlot(), and setSlot().

static char* Slot_toUser ( Slot s  )  [static]

Definition at line 90 of file memory-paranoid.c.

static void slotAbort ( const char *  why,
Slot s 
) [static]

static void checkPad ( char *  pad,
char *  errMsg,
void *  ptr,
Slot s 
) [static]

Definition at line 113 of file memory-paranoid.c.

References slotAbort().

Referenced by checkSlot().

static int badPointer ( Slot p  )  [static]

Definition at line 130 of file memory-paranoid.c.

References c.

Referenced by checkSlot(), and meta_free().

static void checkSlot ( Slot s  )  [static]

void memory_check ( void   ) 

Definition at line 158 of file memory-paranoid.c.

References checkSlot(), CmiMyPe(), CmiPrintf(), Slot::next, and Slot::userSize.

Referenced by CmiMemoryCheck(), freeSlot(), and setSlot().

void CmiMemoryMark ( void   ) 

Definition at line 181 of file memory-paranoid.c.

void CmiMemoryMarkBlock ( void *  blk  ) 

Definition at line 182 of file memory-paranoid.c.

void CmiMemorySweep ( const char *  where  ) 

Definition at line 183 of file memory-paranoid.c.

void CmiMemoryCheck ( void   ) 

Definition at line 185 of file memory-paranoid.c.

References memory_check().

static void* setSlot ( Slot s,
int  userSize 
) [static]

static void freeSlot ( Slot s  )  [static]

static Slot* Slot_fmUser ( void *  user  )  [static]

Definition at line 246 of file memory-paranoid.c.

References checkSlot(), and s.

static int meta_getpagesize ( void   )  [static]

Definition at line 266 of file memory-paranoid.c.

References getpagesize().

static void status ( char *  msg  )  [static]

Definition at line 278 of file memory-paranoid.c.

References CmiArgGivingUsage(), CmiMyPe(), and CmiPrintf().

static void meta_init ( char **  argv  )  [static]

static void* meta_malloc ( size_t  size  )  [static]

Definition at line 307 of file memory-paranoid.c.

References mm_malloc, s, and setSlot().

static void meta_free ( void *  mem  )  [static]

Definition at line 314 of file memory-paranoid.c.

References badPointer(), freeSlot(), Slot::magic, memAbort(), meta_getpagesize(), mm_free, and s.

static void* meta_calloc ( size_t  nelem,
size_t  size 
) [static]

Definition at line 338 of file memory-paranoid.c.

References meta_malloc().

static void meta_cfree ( void *  mem  )  [static]

Definition at line 345 of file memory-paranoid.c.

References meta_free().

static void* meta_realloc ( void *  oldBuffer,
size_t  newSize 
) [static]

Definition at line 350 of file memory-paranoid.c.

References meta_free(), meta_malloc(), size, Slot_fmUser(), and Slot::userSize.

static void* meta_memalign ( size_t  align,
size_t  size 
) [static]

Definition at line 366 of file memory-paranoid.c.

References Slot::magic, meta_getpagesize(), mm_memalign, s, and setSlot().

static void* meta_valloc ( size_t  size  )  [static]

Definition at line 375 of file memory-paranoid.c.

References meta_getpagesize(), and meta_memalign().


Variable Documentation

size_t max_allocated = 0 [static]

Definition at line 35 of file memory-paranoid.c.

Referenced by checkSlot(), and setSlot().

int memory_fill = -1 [static]

Definition at line 75 of file memory-paranoid.c.

int memory_fillphase = 0 [static]

Definition at line 76 of file memory-paranoid.c.

Definition at line 95 of file memory-paranoid.c.

int memory_checkfreq = 100 [static]

Definition at line 100 of file memory-paranoid.c.

int memory_checkphase = 0 [static]

Definition at line 101 of file memory-paranoid.c.

int memory_verbose = 0 [static]

Definition at line 102 of file memory-paranoid.c.

int memoryTraceDisabled = 0 [static]

Definition at line 192 of file memory-paranoid.c.


Generated on Sat May 26 08:08:07 2012 for Charm++ by  doxygen 1.5.5