Skip to content

Reorganize heap context related elements #2500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

akosthekiss
Copy link
Member

  • Moved global context's JMEM_HEAP_SIZE to jcontext.h as external
    context's heap size is declared there, too.
  • Moved the assert on jmem_heap_t vs JMEM_HEAP_SIZE to jcontext.c,
    as both entities are declared in the corresponding header.
  • Removed superfluous checks on JMEM_HEAP_SIZE as it is not a
    publicly configurable macro (opposed to CONFIG_MEM_HEAP_AREA_SIZE).
  • Ensured that all definitions of and references to jmem_heap_t,
    JERRY_HEAP_CONTEXT, JERRY_HEAP_SIZE, and JERRY_HEAP_AREA_SIZE
    are guarded by #ifndef JERRY_SYSTEM_ALLOCATOR, as they are
    meaningless if the system allocator is used.

The commit also contains some stylistic changes in jcontext.h

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu

- Moved global context's `JMEM_HEAP_SIZE` to jcontext.h as external
  context's heap size is declared there, too.
- Moved the assert on `jmem_heap_t` vs `JMEM_HEAP_SIZE` to jcontext.c,
  as both entities are declared in the corresponding header.
- Removed superfluous checks on `JMEM_HEAP_SIZE` as it is not a
  publicly configurable macro (opposed to `CONFIG_MEM_HEAP_AREA_SIZE`).
- Ensured that all definitions of and references to `jmem_heap_t`,
  `JERRY_HEAP_CONTEXT`, `JERRY_HEAP_SIZE`, and `JERRY_HEAP_AREA_SIZE`
  are guarded by `#ifndef JERRY_SYSTEM_ALLOCATOR`, as they are
  meaningless if the system allocator is used.

The commit also contains some stylistic changes in jcontext.h

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
@akosthekiss akosthekiss added the ecma core Related to core ECMA functionality label Aug 31, 2018
@akosthekiss
Copy link
Member Author

Part of the context rework PR series, follow-up to #2498.

Copy link
Member

@zherczeg zherczeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

* 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we use lowercase everywhere.

Copy link
Contributor

@LaszloLango LaszloLango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akosthekiss akosthekiss merged commit c3b6bfe into jerryscript-project:master Aug 31, 2018
@akosthekiss akosthekiss deleted the context-rework-heap branch August 31, 2018 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecma core Related to core ECMA functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants