Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

memory.h File Reference

Header for 'safe' memory stuff, e.g. wrappers for malloc. More...

#include <string.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

void* calloc_safe (size_t nmemb, size_t size)
 Wrapper for calloc. More...

void* malloc_safe (size_t size)
 Wrapper for malloc. More...

void free_safe (void *ptr)
 Wrapper for free. More...

void* realloc_safe (void *ptr, size_t size)
 Wrapper for realloc. More...

char* strdup_safe (const char *s)
 Wrapper for strdup. More...

int cleanup_memory (void)
 Frees all remaining pointers. More...


Detailed Description

Header for 'safe' memory stuff, e.g. wrappers for malloc.

Todo:
The list bit could be better done using a hash of some kind

Make thread safe

Remove counting when debug is 0

Definition in file memory.h.


Function Documentation

void * calloc_safe ( size_t nmemb,
size_t size )
 

Wrapper for calloc.

Definition at line 75 of file plugins/analysis/memory.c.

int cleanup_memory ( void )
 

Frees all remaining pointers.

Returns:
number of outstanding pointers

Definition at line 161 of file plugins/analysis/memory.c.

void free_safe ( void * ptr )
 

Wrapper for free.

Definition at line 111 of file plugins/analysis/memory.c.

Referenced by buildXmlProtocol(), pluginCleanup(), and pluginInit().

void * malloc_safe ( size_t size )
 

Wrapper for malloc.

Definition at line 93 of file plugins/analysis/memory.c.

Referenced by buildXmlDefault(), buildXmlPolicyFromFile(), buildXmlSnort(), convertStringToBArray(), and pluginRegister().

void * realloc_safe ( void * ptr,
size_t size )
 

Wrapper for realloc.

Definition at line 119 of file plugins/analysis/memory.c.

Referenced by buildXmlPolicyFromFile().

char * strdup_safe ( const char * s )
 

Wrapper for strdup.

Definition at line 142 of file plugins/analysis/memory.c.

Referenced by buildXmlProtocol(), and pluginRegister().


Generated at Mon Jul 8 15:16:50 2002 for RUBICON by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000