Merge lcache into context (#2498)

It is superfluous to maintain multiple globals when the whole
reason of context is to keep them in a single place. It also
simplifies initialization and external context creation a bit.

Also removed unused lcache header includes.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This commit is contained in:
Akos Kiss
2018-08-31 13:10:37 +02:00
committed by GitHub
parent a2645601ae
commit 6049c0378d
11 changed files with 9 additions and 90 deletions
-9
View File
@@ -2648,10 +2648,6 @@ jerry_create_instance (uint32_t heap_size, /**< the size of heap */
total_size += heap_size;
#endif /* !JERRY_SYSTEM_ALLOCATOR */
#ifndef CONFIG_ECMA_LCACHE_DISABLE
total_size += sizeof (jerry_hash_table_t);
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
total_size = JERRY_ALIGNUP (total_size, JMEM_ALIGNMENT);
jerry_instance_t *instance_p = (jerry_instance_t *) alloc (total_size, cb_data_p);
@@ -2674,11 +2670,6 @@ jerry_create_instance (uint32_t heap_size, /**< the size of heap */
byte_p += heap_size;
#endif /* !JERRY_SYSTEM_ALLOCATOR */
#ifndef CONFIG_ECMA_LCACHE_DISABLE
instance_p->lcache_p = byte_p;
byte_p += sizeof (jerry_hash_table_t);
#endif /* !JERRY_SYSTEM_ALLOCATOR */
JERRY_ASSERT (byte_p <= ((uint8_t *) instance_p) + total_size);
JERRY_UNUSED (byte_p);