From 40e4d2638bf5720f612e4f66143a46621d08accb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zsolt=20Borb=C3=A9ly?= Date: Wed, 13 Apr 2016 10:56:29 +0200 Subject: [PATCH] After #984 we can increase the heap size to 512K MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com --- jerry-core/config.h | 8 ++++---- jerry-core/mem/mem-heap.c | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/jerry-core/config.h b/jerry-core/config.h index 8b6060cdd..18828e269 100644 --- a/jerry-core/config.h +++ b/jerry-core/config.h @@ -38,9 +38,9 @@ * Size of heap */ #ifndef CONFIG_MEM_HEAP_AREA_SIZE -# define CONFIG_MEM_HEAP_AREA_SIZE (256 * 1024) -#elif CONFIG_MEM_HEAP_AREA_SIZE > (256 * 1024) -# error "Currently, maximum 256 kilobytes heap size is supported" +# define CONFIG_MEM_HEAP_AREA_SIZE (512 * 1024) +#elif CONFIG_MEM_HEAP_AREA_SIZE > (512 * 1024) +# error "Currently, maximum 512 kilobytes heap size is supported" #endif /* !CONFIG_MEM_HEAP_AREA_SIZE */ /** @@ -63,7 +63,7 @@ * * On the other hand, value 2 ^ CONFIG_MEM_HEAP_OFFSET_LOG should not be less than CONFIG_MEM_HEAP_AREA_SIZE. */ -#define CONFIG_MEM_HEAP_OFFSET_LOG (18) +#define CONFIG_MEM_HEAP_OFFSET_LOG (19) /** * Number of lower bits in key of literal hash table. diff --git a/jerry-core/mem/mem-heap.c b/jerry-core/mem/mem-heap.c index 8324e6998..e3cf194a4 100644 --- a/jerry-core/mem/mem-heap.c +++ b/jerry-core/mem/mem-heap.c @@ -202,6 +202,9 @@ mem_heap_init (void) JERRY_STATIC_ASSERT ((uintptr_t) mem_heap.area % MEM_ALIGNMENT == 0, mem_heap_area_must_be_multiple_of_MEM_ALIGNMENT); + JERRY_STATIC_ASSERT ((1u << MEM_HEAP_OFFSET_LOG) >= MEM_HEAP_SIZE, + two_pow_mem_heap_offset_should_not_be_less_than_mem_heap_size); + mem_heap_allocated_size = 0; mem_heap_limit = CONFIG_MEM_HEAP_DESIRED_LIMIT; mem_heap.first.size = 0;