ADMB Documentation  Fournier-pthread.1088
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines
Defines | Functions | Variables
mem.cpp File Reference

(* $Id: mem.cpp 422 2012-04-12 23:02:36Z johnoel $)

#include <stdio.h>
#include <stdlib.h>
#include "safe_mem.h"
#include <assert.h>
#include <string.h>

Go to the source code of this file.

Defines

#define EXIT_FAILURE   1
#define NEAR
#define ferr   stderr

Functions

void mem_setexception (int flag, int(*handler_fp)(void))
static int NEAR mem_exception ()
char * mem_strdup (const char *s)
void * mem_malloc (unsigned numbytes)
void * mem_calloc (unsigned numbytes)
void * mem_realloc (void *oldmem_ptr, unsigned newnumbytes)
void mem_free (void *ptr)
void mem_init ()
void mem_term ()

Variables

int mem_inited = 0
static int mem_behavior = MEM_ABORTMSG
static int(* fp )(void) = NULL
static int mem_count
static int mem_scount

Define Documentation

#define EXIT_FAILURE   1

Definition at line 15 of file mem.cpp.

Referenced by mem_exception().

#define NEAR

Definition at line 19 of file mem.cpp.

#define ferr   stderr

Definition at line 68 of file mem.cpp.

Referenced by mem_exception(), and mem_term().


Function Documentation

void mem_setexception ( int  flag,
int(*)(void)  handler_fp 
)

Definition at line 73 of file mem.cpp.

static int NEAR mem_exception ( ) [static]

Definition at line 96 of file mem.cpp.

Referenced by mem_calloc(), mem_malloc(), and mem_realloc().

char* mem_strdup ( const char *  s)

Definition at line 155 of file mem.cpp.

void* mem_malloc ( unsigned  numbytes)

Definition at line 526 of file mem.cpp.

Referenced by mem_realloc(), and mem_strdup().

void* mem_calloc ( unsigned  numbytes)

Definition at line 548 of file mem.cpp.

void* mem_realloc ( void *  oldmem_ptr,
unsigned  newnumbytes 
)

Definition at line 570 of file mem.cpp.

void mem_free ( void *  ptr)

Definition at line 591 of file mem.cpp.

Referenced by mem_realloc().

void mem_init ( void  )

Definition at line 660 of file mem.cpp.

void mem_term ( void  )

Definition at line 680 of file mem.cpp.


Variable Documentation

Definition at line 57 of file mem.cpp.

Referenced by mem_init(), and mem_term().

Definition at line 59 of file mem.cpp.

Referenced by mem_exception(), and mem_setexception().

int(* fp)(void) = NULL [static]
int mem_count [static]

Definition at line 61 of file mem.cpp.

Referenced by mem_calloc(), mem_free(), mem_init(), mem_malloc(), and mem_term().

int mem_scount [static]

Definition at line 62 of file mem.cpp.

Referenced by mem_term().