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;