From 1f1190a3461dad18d3b811f108207f8dc907c352 Mon Sep 17 00:00:00 2001 From: Ruben Ayrapetyan Date: Wed, 9 Jul 2014 19:24:07 +0400 Subject: [PATCH] Move mem_GetChunkSize to mem-poolman.c from mem-poolman.h. --- src/liballocator/mem-poolman.c | 15 +++++++++++++++ src/liballocator/mem-poolman.h | 16 +--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/liballocator/mem-poolman.c b/src/liballocator/mem-poolman.c index b8a2d1f8f..1c52e42e1 100644 --- a/src/liballocator/mem-poolman.c +++ b/src/liballocator/mem-poolman.c @@ -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 */ diff --git a/src/liballocator/mem-poolman.h b/src/liballocator/mem-poolman.h index 7ac285a29..dd2e08582 100644 --- a/src/liballocator/mem-poolman.h +++ b/src/liballocator/mem-poolman.h @@ -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);