new polarssl
[syren.git] / src / libpolarssl / memory.h
blob3af39511b44655c2e29e01e81f883adfcd53241b
1 /**
2 * \file memory.h
4 * \brief Memory allocation layer (Deprecated to platform layer)
6 * Copyright (C) 2006-2014, Brainspark B.V.
8 * This file is part of PolarSSL (http://www.polarssl.org)
9 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
11 * All rights reserved.
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 #ifndef POLARSSL_MEMORY_H
28 #define POLARSSL_MEMORY_H
30 #if !defined(POLARSSL_CONFIG_FILE)
31 #include "config.h"
32 #else
33 #include POLARSSL_CONFIG_FILE
34 #endif
36 #include <stdlib.h>
38 #if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_MEMORY)
39 #define POLARSSL_PLATFORM_MEMORY
40 #endif
42 #include "platform.h"
43 #include "memory_buffer_alloc.h"
45 int memory_set_own( void * (*malloc_func)( size_t ),
46 void (*free_func)( void * ) )
48 return platform_set_malloc_free( malloc_func, free_func );
52 #endif /* memory.h */