Speeding up procedure for getting start of a heap block's data space for one-chunked blocks, removing general blocks support from the procedure.

- heap area is aligned on heap chunk size;
 - mem_heap_get_block_start is renamed to mem_heap_get_chunked_block_start,
   now this interface is applicable only to one-chunked blocks,
   and is significantly faster - instead of iterating list of heap blocks
   to find block header, it just aligns value of pointer to heap chunk size.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-05-14 22:15:45 +03:00
parent 253e172127
commit 82f9afcde9
4 changed files with 77 additions and 39 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ extern void mem_heap_finalize (void);
extern void* mem_heap_alloc_block (size_t size_in_bytes, mem_heap_alloc_term_t alloc_term);
extern void* mem_heap_alloc_chunked_block (mem_heap_alloc_term_t alloc_term);
extern void mem_heap_free_block (void *ptr);
extern void* mem_heap_get_block_start (void *ptr);
extern void* mem_heap_get_chunked_block_start (void *ptr);
extern size_t mem_heap_get_chunked_block_data_size (void);
extern size_t __attr_pure___ mem_heap_recommend_allocation_size (size_t minimum_allocation_size);
extern void mem_heap_print (bool dump_block_headers, bool dump_block_data, bool dump_stats);