Add info to external pointer free callback. (#4642)

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
This commit is contained in:
Zoltan Herczeg
2021-04-13 09:51:39 +02:00
committed by GitHub
parent b3ec217b50
commit 053389de80
28 changed files with 304 additions and 123 deletions
+6 -2
View File
@@ -106,18 +106,22 @@ handler_throw_test (const jerry_call_info_t *call_info_p, /**< call information
} /* handler_throw_test */
static void
handler_construct_1_freecb (void *native_p)
handler_construct_1_freecb (void *native_p, /**< native pointer */
jerry_object_native_info_t *info_p) /**< native info */
{
TEST_ASSERT ((uintptr_t) native_p == (uintptr_t) 0x0000000000000000ull);
TEST_ASSERT (info_p->free_cb == handler_construct_1_freecb);
printf ("ok object free callback\n");
test_api_is_free_callback_was_called = true;
} /* handler_construct_1_freecb */
static void
handler_construct_2_freecb (void *native_p)
handler_construct_2_freecb (void *native_p, /**< native pointer */
jerry_object_native_info_t *info_p) /**< native info */
{
TEST_ASSERT ((uintptr_t) native_p == (uintptr_t) 0x0012345678abcdefull);
TEST_ASSERT (info_p->free_cb == handler_construct_2_freecb);
printf ("ok object free callback\n");
test_api_is_free_callback_was_called = true;