POK
|
00001 /* 00002 * POK header 00003 * 00004 * The following file is a part of the POK project. Any modification should 00005 * made according to the POK licence. You CANNOT use this file or a part of 00006 * this file is this part of a file for your own project 00007 * 00008 * For more information on the POK licence, please see our LICENCE FILE 00009 * 00010 * Please follow the coding guidelines described in doc/CODING_GUIDELINES 00011 * 00012 * Copyright (c) 2007-2009 POK team 00013 * 00014 * Created by julien on Thu Jul 30 15:49:30 2009 00015 */ 00016 00017 #include <types.h> 00018 #include <core/dependencies.h> 00019 00020 #ifdef POK_NEEDS_ALLOCATOR 00021 00022 /* 00023 * This file contains memory allocation functionnalities. 00024 * You can tweak/tune the memory allocator with the following macros: 00025 * - POK_CONFIG_ALLOCATOR_NB_SPACES : the number of memory spaces 00026 * that can be allocated. It can corresponds to the successive 00027 * call of malloc() or calloc() or pok_allocator_allocate() 00028 * - POK_CONFIG_ALLOCATOR_MEMORY_SIZE : the amount of memory 00029 * the allocator can allocate 00030 */ 00031 00032 void* pok_allocator_allocate (size_t needed_size); 00033 /* 00034 * This function allocates memory. The argument is the amount 00035 * of memory the user needs. This function is called by libc 00036 * functions malloc() and calloc() 00037 */ 00038 00039 void pok_allocator_free (void* ptr); 00040 /* 00041 * This function frees memory. The argument is a previously 00042 * allocated memory chunk. Be careful, the time required 00043 * to free the memory is indeterministic, you should not 00044 * free memory if your program has strong timing requirements. 00045 */ 00046 00047 #endif 00048