From 052c68d2f47cb3b7bdc12a2e3032dc544f3028d6 Mon Sep 17 00:00:00 2001 From: Gavin1012 Date: Fri, 25 Jun 2021 15:13:13 +0800 Subject: [PATCH] expand the heap size to 64kb Signed-off-by: Gavin1012 --- jerry-core/api/external-context-helpers.c | 4 ++-- jerry-port/config-jupiter.h | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/jerry-core/api/external-context-helpers.c b/jerry-core/api/external-context-helpers.c index e5f9fc26..15b7258e 100755 --- a/jerry-core/api/external-context-helpers.c +++ b/jerry-core/api/external-context-helpers.c @@ -34,7 +34,7 @@ static void * bms_task_context_alloc (size_t total_size, void *cb_data_p) */ void bms_task_context_init (void) { - jerry_context_t * bms_task_context = jerry_create_context (GT_TASK_HEAP_SIZE * CONVERTION_RATIO, + jerry_context_t * bms_task_context = jerry_create_context (BMS_TASK_HEAP_SIZE * CONVERTION_RATIO, bms_task_context_alloc, NULL); jerry_port_default_set_current_context (bms_task_context); @@ -60,7 +60,7 @@ static void * js_task_context_alloc (size_t total_size, void *cb_data_p) */ void js_task_context_init (void) { - jerry_context_t * js_task_context = jerry_create_context (GT_TASK_HEAP_SIZE * CONVERTION_RATIO, + jerry_context_t * js_task_context = jerry_create_context (JS_TASK_HEAP_SIZE * CONVERTION_RATIO, js_task_context_alloc, NULL); jerry_port_default_set_current_context (js_task_context); diff --git a/jerry-port/config-jupiter.h b/jerry-port/config-jupiter.h index c9f47edb..1bc8f281 100755 --- a/jerry-port/config-jupiter.h +++ b/jerry-port/config-jupiter.h @@ -15,14 +15,23 @@ #define INPUTJS_BUFFER_SIZE (32 * 1024) #define SNAPSHOT_BUFFER_SIZE (24 * 1024) #define CONVERTION_RATIO (1024) +#define CONTEXT_SIZE_FOR_TASK (3) -#define GT_TASK_HEAP_SIZE (48) -#define BMS_TASK_FOR_CONTEXT_SIZE (3) -#define BMS_TASK_CONTEXT_AND_HEAP_SIZE (GT_TASK_HEAP_SIZE + BMS_TASK_FOR_CONTEXT_SIZE) +#ifndef BMS_TASK_HEAP_SIZE +#define BMS_TASK_HEAP_SIZE (48) +#endif /* BMS_TASK_HEAP_SIZE */ -#define JS_TASK_CONTEXT_AND_HEAP_SIZE_BYTE (51416) // >= 51400 + 8 +#define BMS_TASK_CONTEXT_AND_HEAP_SIZE (BMS_TASK_HEAP_SIZE + CONTEXT_SIZE_FOR_TASK) -#endif // JERRY_IAR_JUPITER -#endif // JERRY_FOR_IAR_CONFIG +#ifndef JS_TASK_HEAP_SIZE +#define JS_TASK_HEAP_SIZE (64) +#endif /* JS_TASK_HEAP_SIZE */ + +// >= 51400 + (64-48) * 1024 + 8 +#define JS_TASK_CONTEXT_AND_HEAP_SIZE_BYTE (JS_TASK_HEAP_SIZE * CONVERTION_RATIO + 2248 + 16) + +#endif /* JERRY_IAR_JUPITER */ + +#endif /* JERRY_FOR_IAR_CONFIG */ #endif // CONFIG_JUPITER_H -- Gitee