Add build option for changing the heap limit (#3005)

This change adds a build option that allows adjusting the garbage
collection heap usage limit, which can be used to fine-tune how often
garbage collection should be triggered.

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 13:35:26 +02:00
committed by Robert Fancsik
parent dec9dbc926
commit 3b7475b01d
6 changed files with 56 additions and 11 deletions
+12
View File
@@ -207,6 +207,15 @@
# define JERRY_GLOBAL_HEAP_SIZE (512)
#endif /* !defined (JERRY_GLOBAL_HEAP_SIZE) */
/**
* The allowed heap usage limit until next garbage collection, in bytes.
*
* If value is 0, the default is 1/32 of JERRY_HEAP_SIZE
*/
#ifndef JERRY_GC_LIMIT
# define JERRY_GC_LIMIT 0
#endif /* !defined (JERRY_GC_LIMIT) */
/**
* Maximum stack usage size in kilobytes
*
@@ -613,6 +622,9 @@
#if !defined (JERRY_GLOBAL_HEAP_SIZE) || (JERRY_GLOBAL_HEAP_SIZE <= 0)
# error "Invalid value for 'JERRY_GLOBAL_HEAP_SIZE' macro."
#endif
#if !defined (JERRY_GC_LIMIT) || (JERRY_GC_LIMIT < 0)
# error "Invalid value for 'JERRY_GC_LIMIT' macro."
#endif
#if !defined (JERRY_STACK_LIMIT) || (JERRY_STACK_LIMIT < 0)
# error "Invalid value for 'JERRY_STACK_LIMIT' macro."
#endif