Style fixes in liballocator, libecmaobjects, libecmaoperations: now lines are not longer than 120 characters.

This commit is contained in:
Ruben Ayrapetyan
2014-08-11 19:51:29 +04:00
parent 0b592470d5
commit 59940fb648
11 changed files with 101 additions and 43 deletions
+6 -4
View File
@@ -86,10 +86,11 @@ typedef enum
*/
typedef struct mem_block_header_t
{
mem_magic_num_of_block_t magic_num; /**< magic number - MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK for allocated block
and MEM_MAGIC_NUM_OF_FREE_BLOCK for free block */
mem_magic_num_of_block_t magic_num; /**< magic number - MEM_MAGIC_NUM_OF_ALLOCATED_BLOCK for allocated block
and MEM_MAGIC_NUM_OF_FREE_BLOCK for free block */
struct mem_block_header_t *neighbours[ MEM_DIRECTION_COUNT ]; /**< neighbour blocks */
size_t allocated_bytes; /**< allocated area size - for allocated blocks; 0 - for free blocks */
size_t allocated_bytes; /**< allocated area size - for allocated blocks;
0 - for free blocks */
} mem_block_header_t;
/**
@@ -509,7 +510,8 @@ size_t
mem_heap_recommend_allocation_size (size_t minimum_allocation_size) /**< minimum allocation size */
{
size_t minimum_allocation_size_with_block_header = minimum_allocation_size + sizeof (mem_block_header_t);
size_t heap_chunk_aligned_allocation_size = JERRY_ALIGNUP(minimum_allocation_size_with_block_header, MEM_HEAP_CHUNK_SIZE);
size_t heap_chunk_aligned_allocation_size = JERRY_ALIGNUP(minimum_allocation_size_with_block_header,
MEM_HEAP_CHUNK_SIZE);
return heap_chunk_aligned_allocation_size - sizeof (mem_block_header_t);
} /* mem_heap_recommend_allocation_size */
+2 -1
View File
@@ -123,7 +123,8 @@ mem_pool_free_chunk (mem_pool_state_t *pool_p, /**< pool */
uint8_t *chunk_p) /**< chunk pointer */
{
JERRY_ASSERT(pool_p->free_chunks_number < pool_p->chunks_number);
JERRY_ASSERT(chunk_p >= MEM_POOL_SPACE_START(pool_p) && chunk_p <= MEM_POOL_SPACE_START(pool_p) + pool_p->chunks_number * MEM_POOL_CHUNK_SIZE);
JERRY_ASSERT(chunk_p >= MEM_POOL_SPACE_START(pool_p)
&& chunk_p <= MEM_POOL_SPACE_START(pool_p) + pool_p->chunks_number * MEM_POOL_CHUNK_SIZE);
JERRY_ASSERT(((uintptr_t) chunk_p - (uintptr_t) MEM_POOL_SPACE_START(pool_p)) % MEM_POOL_CHUNK_SIZE == 0);
mem_check_pool (pool_p);
+8 -6
View File
@@ -40,14 +40,16 @@ typedef uint16_t mem_pool_chunk_index_t;
* State of a memory pool
*/
typedef struct mem_pool_state_t {
unsigned int chunks_number : MEM_POOL_MAX_CHUNKS_NUMBER_LOG; /**< number of chunks (mem_pool_chunk_index_t) */
unsigned int free_chunks_number : MEM_POOL_MAX_CHUNKS_NUMBER_LOG; /**< number of free chunks (mem_pool_chunk_index_t) */
/** Number of chunks (mem_pool_chunk_index_t) */
unsigned int chunks_number : MEM_POOL_MAX_CHUNKS_NUMBER_LOG;
/** Number of free chunks (mem_pool_chunk_index_t) */
unsigned int free_chunks_number : MEM_POOL_MAX_CHUNKS_NUMBER_LOG;
unsigned int first_free_chunk : MEM_POOL_MAX_CHUNKS_NUMBER_LOG; /**< offset of first free chunk
from the beginning of the pool
(mem_pool_chunk_index_t) */
/** Offset of first free chunk from the beginning of the pool (mem_pool_chunk_index_t) */
unsigned int first_free_chunk : MEM_POOL_MAX_CHUNKS_NUMBER_LOG;
unsigned int next_pool_cp : MEM_HEAP_OFFSET_LOG; /**< pointer to the next pool with same chunk size */
/** Pointer to the next pool with same chunk size */
unsigned int next_pool_cp : MEM_HEAP_OFFSET_LOG;
} mem_pool_state_t;
extern void mem_pool_init (mem_pool_state_t *pool_p, size_t pool_size);