Move mem_GetChunkSize to mem-poolman.c from mem-poolman.h.

This commit is contained in:
Ruben Ayrapetyan
2014-07-09 19:24:07 +04:00
parent c54370bfec
commit 1f1190a346
2 changed files with 16 additions and 15 deletions
+15
View File
@@ -72,6 +72,21 @@ static void mem_PoolsStatFreeChunk( mem_PoolChunkType_t);
# define mem_PoolsStatFreeChunk()
#endif /* !MEM_STATS */
/**
* Get chunk size from chunk type.
*
* @return size (in bytes) of chunk of specified type
*/
size_t
mem_GetChunkSize( mem_PoolChunkType_t chunkType) /**< chunk type */
{
uint32_t chunkTypeId = (uint32_t) chunkType;
JERRY_ASSERT( chunkTypeId < MEM_POOL_CHUNK_TYPE__COUNT );
return ( 1u << ( chunkTypeId + 2 ) );
} /* mem_GetChunkSize */
/**
* Initialize pool manager
*/
+1 -15
View File
@@ -51,21 +51,7 @@ typedef enum {
((size) == 64 ? MEM_POOL_CHUNK_TYPE_64 : \
jerry_UnreferencedExpression)))))
/**
* Get chunk size from chunk type.
*
* @return size (in bytes) of chunk of specified type
*/
static size_t
mem_GetChunkSize( mem_PoolChunkType_t chunkType) /**< chunk type */
{
uint32_t chunkTypeId = (uint32_t) chunkType;
JERRY_ASSERT( chunkTypeId < MEM_POOL_CHUNK_TYPE__COUNT );
return ( 1u << ( chunkTypeId + 2 ) );
} /* mem_GetChunkSize */
extern size_t mem_GetChunkSize( mem_PoolChunkType_t chunkType);
extern void mem_PoolsInit(void);
extern uint8_t* mem_PoolsAlloc(mem_PoolChunkType_t chunkType);