jerryscript-project/jerryscript

native callback with object gc

Closed this issue · 2 comments

I'm adding this issue to discuss in open so may help others to understand and join (to the issues)

Codes can be efficient if some native function is called when JS Object is garbage collected so that some block of memory linked to that Object can be freed. Something like MakeWeak in V8.

API something like this;

typedef bool (*jerry_object_free_callback_t) (const jerry_api_object_t* obj);
bool jerry_api_set_objectfreecb(jerryt_api_object_t* obj, jerry_object_free_callback_t handler_p);

had to remove unwanted(wrong DCO) branch
hope 48cc9b5 will do.

5ec3e2f merged to master