mbed TLS library

Dependents:   HTTPClient-SSL WS_SERVER

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers memory.h Source File

memory.h

Go to the documentation of this file.
00001 /**
00002  * \file memory.h
00003  *
00004  * \brief Memory allocation layer
00005  *
00006  * \deprecated Use the platform layer instead
00007  *
00008  *  Copyright (C) 2006-2014, ARM Limited, All Rights Reserved
00009  *
00010  *  This file is part of mbed TLS (https://tls.mbed.org)
00011  *
00012  *  This program is free software; you can redistribute it and/or modify
00013  *  it under the terms of the GNU General Public License as published by
00014  *  the Free Software Foundation; either version 2 of the License, or
00015  *  (at your option) any later version.
00016  *
00017  *  This program is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU General Public License for more details.
00021  *
00022  *  You should have received a copy of the GNU General Public License along
00023  *  with this program; if not, write to the Free Software Foundation, Inc.,
00024  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00025  */
00026 #ifndef POLARSSL_MEMORY_H
00027 #define POLARSSL_MEMORY_H
00028 
00029 #if !defined(POLARSSL_CONFIG_FILE)
00030 #include "config.h"
00031 #else
00032 #include POLARSSL_CONFIG_FILE
00033 #endif
00034 
00035 #include <stdlib.h>
00036 
00037 #include "platform.h"
00038 #include "memory_buffer_alloc.h"
00039 
00040 #if ! defined(POLARSSL_DEPRECATED_REMOVED)
00041 #if defined(POLARSSL_DEPRECATED_WARNING)
00042 #define DEPRECATED    __attribute__((deprecated))
00043 #else
00044 #define DEPRECATED
00045 #endif
00046 /**
00047  * \brief   Set malloc() / free() callback
00048  *
00049  * \deprecated Use platform_set_malloc_free instead
00050  */
00051 int memory_set_own( void * (*malloc_func)( size_t ),
00052                     void (*free_func)( void * ) ) DEPRECATED;
00053 int memory_set_own( void * (*malloc_func)( size_t ),
00054                     void (*free_func)( void * ) )
00055 {
00056     return platform_set_malloc_free( malloc_func, free_func );
00057 }
00058 #undef DEPRECATED
00059 #endif /* POLARSSL_DEPRECATED_REMOVED */
00060 
00061 
00062 #endif /* memory.h */
00063