Orocos Real-Time Toolkit  2.8.3
tlsf.h
Go to the documentation of this file.
1 /*
2  * Two Levels Segregate Fit memory allocator (TLSF)
3  * Version 2.4.4
4  *
5  * Written by Miguel Masmano Tello <mimastel@doctor.upv.es>
6  *
7  * Thanks to Ismael Ripoll for his suggestions and reviews
8  *
9  * Copyright (C) 2008, 2007, 2006, 2005, 2004
10  *
11  * This code is released using a dual license strategy: GPL/LGPL
12  * You can choose the licence that better fits your requirements.
13  *
14  * Released under the terms of the GNU General Public License Version 2.0
15  * Released under the terms of the GNU Lesser General Public License Version 2.1
16  *
17  */
18 
19 #ifndef _TLSF_H_
20 #define _TLSF_H_
21 
22 /* We avoid name clashes with other projects and
23  * only make the required function available
24  */
25 #include "../fosi.h"
26 #define tlsf_malloc oro_rt_malloc
27 #define tlsf_free oro_rt_free
28 #define tlsf_realloc oro_rt_realloc
29 #define tlsf_calloc oro_rt_calloc
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #ifdef ORO_MEMORY_POOL
36 extern size_t init_memory_pool(size_t, void *);
37 extern size_t get_used_size(void *);
38 extern size_t get_used_size_mp();
39 extern size_t get_max_size(void *);
40 extern size_t get_max_size_mp();
41 extern void destroy_memory_pool(void *);
42 extern size_t add_new_area(void *, size_t, void *);
43 extern void *malloc_ex(size_t, void *);
44 extern void free_ex(void *, void *);
45 extern void *realloc_ex(void *, size_t, void *);
46 extern void *calloc_ex(size_t, size_t, void *);
47 #endif
48 
49 extern void *tlsf_malloc(size_t size);
50 extern void tlsf_free(void *ptr);
51 extern void *tlsf_realloc(void *ptr, size_t size);
52 extern void *tlsf_calloc(size_t nelem, size_t elem_size);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
#define tlsf_calloc
Definition: tlsf.h:29
#define tlsf_free
Definition: tlsf.h:27
#define tlsf_realloc
Definition: tlsf.h:28
#define tlsf_malloc
Definition: tlsf.h:26