aboutsummaryrefslogtreecommitdiff
path: root/jerry-core/jcontext/jcontext.c
diff options
context:
space:
mode:
Diffstat (limited to 'jerry-core/jcontext/jcontext.c')
-rw-r--r--jerry-core/jcontext/jcontext.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/jerry-core/jcontext/jcontext.c b/jerry-core/jcontext/jcontext.c
index 959e0c78..199b871d 100644
--- a/jerry-core/jcontext/jcontext.c
+++ b/jerry-core/jcontext/jcontext.c
@@ -20,11 +20,20 @@
*/
#ifndef JERRY_ENABLE_EXTERNAL_CONTEXT
+
/**
* Global context.
*/
jerry_context_t jerry_global_context;
+#ifndef JERRY_SYSTEM_ALLOCATOR
+
+/**
+ * Check size of heap is corresponding to configuration
+ */
+JERRY_STATIC_ASSERT (sizeof (jmem_heap_t) <= JMEM_HEAP_SIZE,
+ size_of_mem_heap_must_be_less_than_or_equal_to_JMEM_HEAP_SIZE);
+
/**
* Jerry global heap section attribute.
*/
@@ -34,11 +43,11 @@ jerry_context_t jerry_global_context;
#define JERRY_GLOBAL_HEAP_SECTION JERRY_ATTR_SECTION (JERRY_HEAP_SECTION_ATTR)
#endif /* !JERRY_HEAP_SECTION_ATTR */
-#ifndef JERRY_SYSTEM_ALLOCATOR
/**
* Global heap.
*/
jmem_heap_t jerry_global_heap JERRY_ATTR_ALIGNED (JMEM_ALIGNMENT) JERRY_GLOBAL_HEAP_SECTION;
+
#endif /* !JERRY_SYSTEM_ALLOCATOR */
#endif /* !JERRY_ENABLE_EXTERNAL_CONTEXT */