Skip to content

Conversation

@zherczeg
Copy link
Member

Furthermore reduce memory consumption when only one external pointer is assigned to an object.

@zherczeg zherczeg force-pushed the native_ptr_rework branch 3 times, most recently from f4d813c to cc44908 Compare March 31, 2021 06:18
@zherczeg zherczeg force-pushed the native_ptr_rework branch from cc44908 to bf69fa4 Compare April 1, 2021 05:41
Copy link
Contributor

@galpeter galpeter left a comment

Choose a reason for hiding this comment

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

Minor doc change requests.

**Prototype**

```c
typedef void (*jerry_value_free_callback_t) (void *native_p);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was wondering if it would make sense to have a "type" information as second argument for this callback. What do you think? Could this be a useful feature? This "type" could/would indicate what kind of data should be freed.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am neutral. If others think this is a good idea we could do it in another patch (before release).

Copy link
Contributor

Choose a reason for hiding this comment

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

That's true. We could even do a different WIP PR to see how it would look.

**Summary**

Native free callback of an object. It is used in `jerry_object_native_info_t` and for external Array buffers.
Native free callback of an object. It is part of the type information provided by `jerry_object_native_info_t`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand what do you mean with the It is part of the type information provided by jerry_object_native_info_t. sentence.

Copy link
Member Author

Choose a reason for hiding this comment

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

jerry_object_native_info_t structure represents the internal type information of an object, and jerry_object_native_free_callback_t is a mandatory part of this type info. Let me know if you would prefer another sentence.

Copy link
Contributor

Choose a reason for hiding this comment

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

For me the new sentence does not provide extra info, maybe?: Native free callback of an object. In addition to the memory pointer the callback receives the native info pointer which was provided by the jerry_set_native_ptr... method.

@zherczeg zherczeg force-pushed the native_ptr_rework branch from bf69fa4 to 94049eb Compare April 6, 2021 17:48
@zherczeg
Copy link
Member Author

zherczeg commented Apr 7, 2021

Patch is updated, please check.

Copy link
Contributor

@galpeter galpeter left a comment

Choose a reason for hiding this comment

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

lgtm

@zherczeg zherczeg force-pushed the native_ptr_rework branch from 94049eb to 1b15414 Compare April 13, 2021 07:23
Furthermore reduce memory consumption when only
one external pointer is assigned to an object.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
@zherczeg zherczeg force-pushed the native_ptr_rework branch from 1b15414 to 85dd50c Compare April 13, 2021 07:30
@zherczeg zherczeg merged commit 053389d into jerryscript-project:master Apr 13, 2021
@zherczeg zherczeg deleted the native_ptr_rework branch April 13, 2021 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants