Add realloc function to jmem (#2998)

This patch extends jmem functionality by adding a realloc function.
This opens up other paths of optimization which can result in smaller
peak memory usage and faster execution times, due to not having to
duplicate memory when we need to extend blocks.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This commit is contained in:
Dániel Bátyai
2019-08-06 17:59:49 +02:00
committed by Robert Fancsik
parent 3b7475b01d
commit 566e81451e
3 changed files with 335 additions and 36 deletions
+1
View File
@@ -108,6 +108,7 @@ void jmem_finalize (void);
void *jmem_heap_alloc_block (const size_t size);
void *jmem_heap_alloc_block_null_on_error (const size_t size);
void *jmem_heap_realloc_block (void *ptr, const size_t old_size, const size_t new_size);
void jmem_heap_free_block (void *ptr, const size_t size);
#if ENABLED (JERRY_MEM_STATS)