Move mem_GetChunkSize to mem-poolman.c from mem-poolman.h.
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user