Add heap size limit
to solve #342 JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
This commit is contained in:
@@ -83,6 +83,7 @@ project (Jerry CXX C ASM)
|
||||
|
||||
set(EXTERNAL_LIBC_INTERFACE "UNDEFINED" CACHE STRING "Path to external libc include directory")
|
||||
set(EXTERNAL_LIBS_INTERFACE "UNDEFINED" CACHE STRING "Path to external libraries' include directory")
|
||||
set(EXTERNAL_MEM_HEAP_SIZE_KB "256" CACHE STRING "Size of memory heap, in kilobytes")
|
||||
else()
|
||||
message(FATAL_ERROR "Platform '${PLATFORM}' is not supported")
|
||||
endif()
|
||||
|
||||
@@ -88,6 +88,12 @@ project (JerryCore CXX C ASM)
|
||||
math(EXPR MEM_HEAP_AREA_SIZE_16K "16 * 1024")
|
||||
set(DEFINES_JERRY_MCU_STM32F4 CONFIG_MEM_HEAP_AREA_SIZE=${MEM_HEAP_AREA_SIZE_16K})
|
||||
|
||||
# External
|
||||
if(DEFINED EXTERNAL_MEM_HEAP_SIZE_KB)
|
||||
math(EXPR MEM_HEAP_AREA_SIZE_EXTERNAL "${EXTERNAL_MEM_HEAP_SIZE_KB} * 1024")
|
||||
set(DEFINES_JERRY_EXTERNAL CONFIG_MEM_HEAP_AREA_SIZE=${MEM_HEAP_AREA_SIZE_EXTERNAL})
|
||||
endif()
|
||||
|
||||
# Include directories
|
||||
set(INCLUDE_CORE
|
||||
${CMAKE_SOURCE_DIR}/jerry-core
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
*/
|
||||
#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"
|
||||
#endif /* !CONFIG_MEM_HEAP_AREA_SIZE */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user