POK
allocator.h
1 /*
2  * POK header
3  *
4  * The following file is a part of the POK project. Any modification should
5  * made according to the POK licence. You CANNOT use this file or a part of
6  * this file is this part of a file for your own project
7  *
8  * For more information on the POK licence, please see our LICENCE FILE
9  *
10  * Please follow the coding guidelines described in doc/CODING_GUIDELINES
11  *
12  * Copyright (c) 2007-2009 POK team
13  *
14  * Created by julien on Thu Jul 30 15:49:30 2009
15  */
16 
17 #include <types.h>
18 #include <core/dependencies.h>
19 
20 #ifdef POK_NEEDS_ALLOCATOR
21 
22 /*
23  * This file contains memory allocation functionnalities.
24  * You can tweak/tune the memory allocator with the following macros:
25  * - POK_CONFIG_ALLOCATOR_NB_SPACES : the number of memory spaces
26  * that can be allocated. It can corresponds to the successive
27  * call of malloc() or calloc() or pok_allocator_allocate()
28  * - POK_CONFIG_ALLOCATOR_MEMORY_SIZE : the amount of memory
29  * the allocator can allocate
30  */
31 
32 void* pok_allocator_allocate (size_t needed_size);
33 /*
34  * This function allocates memory. The argument is the amount
35  * of memory the user needs. This function is called by libc
36  * functions malloc() and calloc()
37  */
38 
39 void pok_allocator_free (void* ptr);
40 /*
41  * This function frees memory. The argument is a previously
42  * allocated memory chunk. Be careful, the time required
43  * to free the memory is indeterministic, you should not
44  * free memory if your program has strong timing requirements.
45  */
46 
47 #endif
48