/builddir/build/BUILD/gru-0.2.0/src/common/gru_alloc.c File Reference

#include "gru_alloc.h"

Functions

void * gru_alloc (size_t size, gru_status_t *status)
 Allocate a block of memory.
void gru_dealloc (void **obj)
 Deallocate a block of memory and set its pointer to NULL.
void gru_dealloc_string (char **obj)
 Deallocate a block of memory used by a char * and set its pointer to NULL.
void gru_dealloc_const_string (const char **obj)
 Deallocate a block of memory used by a const char * and set its pointer to NULL.

Function Documentation

void* gru_alloc ( size_t  size,
gru_status_t status 
)

Allocate a block of memory.

Parameters:
size the amount of memory (in bytes) to allocate
status a status pointer that will be set in case of failure
Returns:
a pointer to the newly allocated memory or NULL if failed
void gru_dealloc ( void **  obj  ) 

Deallocate a block of memory and set its pointer to NULL.

Parameters:
obj a pointer to a pointer of block of memory to deallocate
void gru_dealloc_const_string ( const char **  obj  )  [inline]

Deallocate a block of memory used by a const char * and set its pointer to NULL.

Parameters:
obj a pointer to a pointer of block of memory to deallocate
void gru_dealloc_string ( char **  obj  )  [inline]

Deallocate a block of memory used by a char * and set its pointer to NULL.

Parameters:
obj a pointer to a pointer of block of memory to deallocate
Examples:
string/gru_serialize_test.c.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 7 Jan 2019 for GRU - Generic Reusable Utilities by  doxygen 1.6.1