Rework memory statistics to provide useful user information. (#1812)

Obsolote statistics is also removed.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2017-05-16 02:52:12 +02:00
committed by yichoi
parent f5b385ca6c
commit f4fbf0b0b5
18 changed files with 347 additions and 246 deletions
+8
View File
@@ -373,6 +373,10 @@ snapshot_load_compiled_code (const uint8_t *snapshot_data_p, /**< snapshot data
{
bytecode_p = (ecma_compiled_code_t *) jmem_heap_alloc_block (code_size);
#ifdef JMEM_STATS
jmem_stats_allocate_byte_code_bytes (code_size);
#endif /* JMEM_STATS */
memcpy (bytecode_p, snapshot_data_p + offset, code_size);
}
else
@@ -384,6 +388,10 @@ snapshot_load_compiled_code (const uint8_t *snapshot_data_p, /**< snapshot data
bytecode_p = (ecma_compiled_code_t *) jmem_heap_alloc_block (total_size);
#ifdef JMEM_STATS
jmem_stats_allocate_byte_code_bytes (total_size);
#endif /* JMEM_STATS */
memcpy (bytecode_p, snapshot_data_p + offset, code_size);
bytecode_p->size = (uint16_t) (total_size >> JMEM_ALIGNMENT_LOG);