OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
xmalloc.h File Reference
#include "common.h"
Include dependency graph for xmalloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BEGIN_C_DECLS
 
#define END_C_DECLS
 
#define XCALLOC(type, num)   ((type*) xcalloc ((size_t)(num), (size_t)sizeof(type)))
 
#define XMALLOC(type, num)   ((type*) xmalloc((size_t)((num) * sizeof(type))))
 
#define XREALLOC(type, p, num)   ((type*) xrealloc ((p), (size_t)((num) * sizeof(type))))
 
#define XFREE(stale)
 

Functions

BEGIN_C_DECLS void * xcalloc (size_t num, size_t size)
 
void * xmalloc (size_t num)
 
void * xrealloc (void *p, size_t num)
 

Macro Definition Documentation

◆ BEGIN_C_DECLS

#define BEGIN_C_DECLS

Definition at line 29 of file xmalloc.h.

◆ END_C_DECLS

#define END_C_DECLS

Definition at line 30 of file xmalloc.h.

◆ XCALLOC

#define XCALLOC (   type,
  num 
)    ((type*) xcalloc ((size_t)(num), (size_t)sizeof(type)))

Definition at line 33 of file xmalloc.h.

◆ XFREE

#define XFREE (   stale)
Value:
do { \
if (stale) { free(stale); stale=0; } \
} while (0)

Definition at line 42 of file xmalloc.h.

◆ XMALLOC

#define XMALLOC (   type,
  num 
)    ((type*) xmalloc((size_t)((num) * sizeof(type))))

Definition at line 36 of file xmalloc.h.

◆ XREALLOC

#define XREALLOC (   type,
  p,
  num 
)    ((type*) xrealloc ((p), (size_t)((num) * sizeof(type))))

Definition at line 39 of file xmalloc.h.

Function Documentation

◆ xcalloc()

BEGIN_C_DECLS void* xcalloc ( size_t  num,
size_t  size 
)

Definition at line 50 of file xmalloc.c.

◆ xmalloc()

void* xmalloc ( size_t  num)

Definition at line 23 of file xmalloc.c.

◆ xrealloc()

void* xrealloc ( void *  p,
size_t  num 
)

Definition at line 34 of file xmalloc.c.