Fix collection of memory statistics in pool allocator.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-08-17 15:05:40 +03:00
parent 589ebb1802
commit 4c67403f15
+6
View File
@@ -629,6 +629,8 @@ mem_pools_stat_alloc_pool (void)
{
mem_pools_stats.global_peak_pools_count = mem_pools_stats.pools_count;
}
mem_pools_stats.free_chunks += MEM_POOL_CHUNKS_NUMBER;
} /* mem_pools_stat_alloc_pool */
/**
@@ -637,6 +639,10 @@ mem_pools_stat_alloc_pool (void)
static void
mem_pools_stat_free_pool (void)
{
JERRY_ASSERT (mem_pools_stats.free_chunks >= MEM_POOL_CHUNKS_NUMBER);
mem_pools_stats.free_chunks -= MEM_POOL_CHUNKS_NUMBER;
JERRY_ASSERT (mem_pools_stats.pools_count > 0);
mem_pools_stats.pools_count--;