Introduce JERRY_DISABLE_HEAVY_DEBUG preprocessor definiton to speed up debug version of the engine.

Heavy debug is enabled only for unit tests.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-06-15 17:04:44 +03:00
parent d803c3bc82
commit a293e21147
9 changed files with 30 additions and 21 deletions
+2 -2
View File
@@ -1058,7 +1058,7 @@ mem_heap_print (bool dump_block_headers, /**< print block headers */
static void
mem_check_heap (void)
{
#ifndef JERRY_NDEBUG
#ifndef JERRY_DISABLE_HEAVY_DEBUG
JERRY_ASSERT ((uint8_t*) mem_heap.first_block_p == mem_heap.heap_start);
JERRY_ASSERT (mem_heap.heap_size % MEM_HEAP_CHUNK_SIZE == 0);
@@ -1131,7 +1131,7 @@ mem_check_heap (void)
JERRY_ASSERT (chunk_sizes_sum * MEM_HEAP_CHUNK_SIZE == mem_heap.heap_size);
JERRY_ASSERT (is_first_block_was_met);
#endif /* !JERRY_NDEBUG */
#endif /* !JERRY_DISABLE_HEAVY_DEBUG */
} /* mem_check_heap */
#ifdef MEM_STATS
+5 -3
View File
@@ -181,9 +181,9 @@ mem_pool_free_chunk (mem_pool_state_t *pool_p, /**< pool */
* Check pool state consistency
*/
static void
mem_check_pool (mem_pool_state_t __attr_unused___ *pool_p) /**< pool (unused #ifdef JERRY_NDEBUG) */
mem_check_pool (mem_pool_state_t __attr_unused___ *pool_p) /**< pool (unused #ifdef JERRY_DISABLE_HEAVY_DEBUG) */
{
#ifndef JERRY_NDEBUG
#ifndef JERRY_DISABLE_HEAVY_DEBUG
JERRY_ASSERT (pool_p->free_chunks_number <= MEM_POOL_CHUNKS_NUMBER);
size_t met_free_chunks_number = 0;
@@ -204,7 +204,9 @@ mem_check_pool (mem_pool_state_t __attr_unused___ *pool_p) /**< pool (unused #if
}
JERRY_ASSERT (met_free_chunks_number == pool_p->free_chunks_number);
#endif /* !JERRY_NDEBUG */
#else /* !JERRY_DISABLE_HEAVY_DEBUG */
(void) pool_p;
#endif /* JERRY_DISABLE_HEAVY_DEBUG */
} /* mem_check_pool */
/**