blob: 64690bed9da8620756c02467434094eae763405f [file] [log] [blame]
Paul Bakker6e339b52013-07-03 13:37:05 +02001/**
2 * \file memory.h
3 *
Paul Bakkerdefc0ca2014-02-04 17:30:24 +01004 * \brief Memory allocation layer (Deprecated to platform layer)
Paul Bakker6e339b52013-07-03 13:37:05 +02005 *
Paul Bakkerdefc0ca2014-02-04 17:30:24 +01006 * Copyright (C) 2006-2014, Brainspark B.V.
Paul Bakker6e339b52013-07-03 13:37:05 +02007 *
8 * This file is part of PolarSSL (http://www.polarssl.org)
9 * Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
10 *
11 * All rights reserved.
12 *
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.
17 *
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.
22 *
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.
26 */
27#ifndef POLARSSL_MEMORY_H
28#define POLARSSL_MEMORY_H
29
30#include "config.h"
31
32#include <stdlib.h>
33
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010034#if defined(POLARSSL_MEMORY_C) && !defined(POLARSSL_PLATFORM_MEMORY)
35#define POLARSSL_PLATFORM_MEMORY
Paul Bakker6e339b52013-07-03 13:37:05 +020036#endif
37
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010038#include "platform.h"
39#include "memory_buffer_alloc.h"
Paul Bakker6e339b52013-07-03 13:37:05 +020040
Paul Bakker6e339b52013-07-03 13:37:05 +020041int memory_set_own( void * (*malloc_func)( size_t ),
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010042 void (*free_func)( void * ) )
43{
44 return platform_set_malloc_free( malloc_func, free_func );
Paul Bakker6e339b52013-07-03 13:37:05 +020045}
Paul Bakkerdefc0ca2014-02-04 17:30:24 +010046
Paul Bakker6e339b52013-07-03 13:37:05 +020047
48#endif /* memory.h */