Xively Official / mbed-libxively-5d6fdd4

Dependents:   xively-jumpstart-demo

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers xi_allocator.h Source File

xi_allocator.h

Go to the documentation of this file.
00001 // Copyright (c) 2003-2013, LogMeIn, Inc. All rights reserved.
00002 // This is part of Xively C library, it is under the BSD 3-Clause license.
00003 
00004 /**
00005  * \file    xi_allocator.h
00006  * \author  Olgierd Humenczuk
00007  * \brief   Our custom `alloc()` and `free()`
00008  *
00009  *    This is a faced built for future use when limitation of certain embedded
00010  *    devices require custom memory management, e.g. pooling and leak detection.
00011  */
00012 
00013 #ifndef __XI_ALLOCATOR_H__
00014 #define __XI_ALLOCATOR_H__
00015 
00016 #ifdef __cplusplus
00017 extern "C" {
00018 #endif
00019 
00020 /**
00021  * \brief   Behaves like usual `malloc()`, which is supposed to allocate a chunk
00022  *             of memory and return the pointer to it.
00023  *
00024  * \return  Pointer to allocated memory or null in case of any error.
00025  */
00026 void* xi_alloc( size_t bytes );
00027 
00028 /**
00029  * \brief   Behaves like usual `free()`, it frees previously allocated chunk of
00030  *             of memory.
00031  */
00032 void xi_free( void* pointer );
00033 
00034 #ifdef __cplusplus
00035 }
00036 #endif
00037 
00038 #endif