Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
prmem.h File Reference
#include "prtypes.h"
#include <stdlib.h>

Go to the source code of this file.


#define PR_MALLOC(_bytes)   (PR_Malloc((_bytes)))
#define PR_NEW(_struct)   ((_struct *) PR_MALLOC(sizeof(_struct)))
#define PR_REALLOC(_ptr, _size)   (PR_Realloc((_ptr), (_size)))
#define PR_CALLOC(_size)   (PR_Calloc(1, (_size)))
#define PR_NEWZAP(_struct)   ((_struct*)PR_Calloc(1, sizeof(_struct)))
#define PR_DELETE(_ptr)   { PR_Free(_ptr); (_ptr) = NULL; }
#define PR_FREEIF(_ptr)   if (_ptr) PR_DELETE(_ptr)


PR_BEGIN_EXTERN_C NSPR_API (void *) PR_Malloc(PRUint32 size)
 NSPR_API (void) PR_Free(void *ptr)
 Prototypes for machine dependent function implementations.


PRUint32 elsize
PRUint32 size

Define Documentation

#define PR_CALLOC (   _size)    (PR_Calloc(1, (_size)))

Definition at line 120 of file prmem.h.

#define PR_DELETE (   _ptr)    { PR_Free(_ptr); (_ptr) = NULL; }

Definition at line 142 of file prmem.h.

#define PR_FREEIF (   _ptr)    if (_ptr) PR_DELETE(_ptr)

Definition at line 154 of file prmem.h.

#define PR_MALLOC (   _bytes)    (PR_Malloc((_bytes)))

Definition at line 87 of file prmem.h.

#define PR_NEW (   _struct)    ((_struct *) PR_MALLOC(sizeof(_struct)))

Definition at line 97 of file prmem.h.

#define PR_NEWZAP (   _struct)    ((_struct*)PR_Calloc(1, sizeof(_struct)))

Definition at line 131 of file prmem.h.

#define PR_REALLOC (   _ptr,
)    (PR_Realloc((_ptr), (_size)))

Definition at line 109 of file prmem.h.

Function Documentation

NSPR_API ( void  )

Prototypes for machine dependent function implementations.

(Too bad NSPR's MD system blows so much that we have to reiterate every stinking thing we implement here in our MD header file.)

Variable Documentation

Definition at line 68 of file prmem.h.

Definition at line 70 of file prmem.h.