m_mem.h File Reference


Detailed Description

Memory management routines. Some prototypes are copied from glib, but we don't link to glib in case a user doesn't want to have to link to glib in their program.

Go to the source code of this file.

Functions

void * m_try_malloc (size_t size)
 Attempd to allocate size bytes, and return NULL on failure. Does not initialize the memory.
void * m_try_malloc0 (size_t size)
 Attempt to allocate size bytes, initialized to 0's, and return NULL on failure.
void * m_try_realloc (void *ptr, size_t size)
 reallocate memory, the new memory is uninitialized.
void m_free (void *ptr)
 Free the memory referenced by ptr. If ptr is NULL, no operation is performed.


Function Documentation

void* m_try_malloc ( size_t  size  ) 

Attempd to allocate size bytes, and return NULL on failure. Does not initialize the memory.

Parameters:
size number of bytes to allocate
Returns:
the allocated memory, or NULL

void* m_try_malloc0 ( size_t  size  ) 

Attempt to allocate size bytes, initialized to 0's, and return NULL on failure.

Parameters:
size number of bytes to allocate
Returns:
the allocated memory, or NULL

void m_free ( void *  ptr  ) 

Free the memory referenced by ptr. If ptr is NULL, no operation is performed.

Parameters:
ptr pointer to memory


Generated on Tue May 12 14:40:00 2009 for mondemand by  doxygen 1.4.7