-
Notifications
You must be signed in to change notification settings - Fork 683
More gc-friendly property hashmap allocation. #1195
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
More gc-friendly property hashmap allocation. #1195
Conversation
ecma_property_hashmap_free (obj_iter_p); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need the newline above.
cab46be
to
52a9ca9
Compare
@@ -110,7 +110,12 @@ ecma_property_hashmap_create (ecma_object_t *object_p) /**< object */ | |||
|
|||
size_t total_size = ECMA_PROPERTY_HASHMAP_GET_TOTAL_SIZE (max_property_count); | |||
|
|||
ecma_property_hashmap_t *hashmap_p = (ecma_property_hashmap_t *) jmem_heap_alloc_block (total_size); | |||
ecma_property_hashmap_t *hashmap_p = (ecma_property_hashmap_t *) jmem_heap_alloc_block_null_on_error (total_size); | |||
if (hashmap_p == NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could think about a strategy what should happen if we are on low-memory conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: add a newline before the 'if'.
LGTM |
52a9ca9
to
d79cec6
Compare
return jmem_heap_gc_and_alloc_block (size); | ||
} /* jmem_heap_alloc_block_null_on_error */ | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only one newline please.
d79cec6
to
2e16019
Compare
After the newline is added, LGTM. |
2e16019
to
6da9180
Compare
I've added the new line. |
@ktorpi, please rebase |
- New allocator is added that returns null on out of memory, property hasmap create uses this allocator for now. - Property hashmaps of objects are removed durring a high severity gc. Follow up patch is in progress. JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
6da9180
to
e7ec053
Compare
A follow up patch is in progress.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu