Styles fixes in liballocator: indentation and braces rules.

This commit is contained in:
Ruben Ayrapetyan
2014-08-11 21:10:06 +04:00
parent 59940fb648
commit 38c6c2357d
7 changed files with 364 additions and 354 deletions
+31 -31
View File
@@ -53,28 +53,28 @@ mem_finalize (bool is_show_mem_stats) /**< show heap memory stats
mem_pools_finalize ();
if (is_show_mem_stats)
{
mem_heap_print (false, false, true);
{
mem_heap_print (false, false, true);
#ifdef MEM_STATS
mem_pools_stats_t stats;
mem_pools_get_stats (&stats);
mem_pools_stats_t stats;
mem_pools_get_stats (&stats);
__printf ("Pools stats:\n");
__printf (" Chunk size: %u\n"
" Pools: %lu\n"
" Allocated chunks: %lu\n"
" Free chunks: %lu\n"
" Peak pools: %lu\n"
" Peak allocated chunks: %lu\n\n",
MEM_POOL_CHUNK_SIZE,
stats.pools_count,
stats.allocated_chunks,
stats.free_chunks,
stats.peak_pools_count,
stats.peak_allocated_chunks);
__printf ("Pools stats:\n");
__printf (" Chunk size: %u\n"
" Pools: %lu\n"
" Allocated chunks: %lu\n"
" Free chunks: %lu\n"
" Peak pools: %lu\n"
" Peak allocated chunks: %lu\n\n",
MEM_POOL_CHUNK_SIZE,
stats.pools_count,
stats.allocated_chunks,
stats.free_chunks,
stats.peak_pools_count,
stats.peak_allocated_chunks);
#endif /* MEM_STATS */
}
}
mem_heap_finalize ();
} /* mem_finalize */
@@ -94,20 +94,20 @@ mem_get_base_pointer (void)
uintptr_t
mem_compress_pointer (void *pointer) /**< pointer to compress */
{
JERRY_ASSERT(pointer != NULL);
JERRY_ASSERT(pointer != NULL);
uintptr_t int_ptr = (uintptr_t) pointer;
uintptr_t int_ptr = (uintptr_t) pointer;
JERRY_ASSERT(int_ptr % MEM_ALIGNMENT == 0);
JERRY_ASSERT(int_ptr % MEM_ALIGNMENT == 0);
int_ptr -= mem_get_base_pointer ();
int_ptr >>= MEM_ALIGNMENT_LOG;
int_ptr -= mem_get_base_pointer ();
int_ptr >>= MEM_ALIGNMENT_LOG;
JERRY_ASSERT((int_ptr & ~((1u << MEM_HEAP_OFFSET_LOG) - 1)) == 0);
JERRY_ASSERT((int_ptr & ~((1u << MEM_HEAP_OFFSET_LOG) - 1)) == 0);
JERRY_ASSERT(int_ptr != MEM_COMPRESSED_POINTER_NULL);
JERRY_ASSERT(int_ptr != MEM_COMPRESSED_POINTER_NULL);
return int_ptr;
return int_ptr;
} /* mem_compress_pointer */
/**
@@ -116,12 +116,12 @@ mem_compress_pointer (void *pointer) /**< pointer to compress */
void*
mem_decompress_pointer (uintptr_t compressed_pointer) /**< pointer to decompress */
{
JERRY_ASSERT(compressed_pointer != MEM_COMPRESSED_POINTER_NULL);
JERRY_ASSERT(compressed_pointer != MEM_COMPRESSED_POINTER_NULL);
uintptr_t int_ptr = compressed_pointer;
uintptr_t int_ptr = compressed_pointer;
int_ptr <<= MEM_ALIGNMENT_LOG;
int_ptr += mem_get_base_pointer ();
int_ptr <<= MEM_ALIGNMENT_LOG;
int_ptr += mem_get_base_pointer ();
return (void*) int_ptr;
return (void*) int_ptr;
} /* mem_decompress_pointer */