From: Alviro Iskandar Setiawan <[email protected]>
To: Ammar Faizi <[email protected]>
Cc: Muhammad Rizki <[email protected]>,
Kanna Scarlet <[email protected]>,
"GNU/Weeb Mailing List" <[email protected]>
Subject: Re: [GIT PULL] chnet updates
Date: Tue, 4 Oct 2022 06:25:50 +0700 [thread overview]
Message-ID: <CAOG64qPdFAZFK9T1i+sh5MQaDGeeScGwoLk9BsinrtCgKnY6yA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
On Mon, Oct 3, 2022 at 6:55 PM Ammar Faizi wrote:
> Hi Al,
>
> Various chnet updates. Mostly just general updates, the most noticable
> change is the recent memory leak bug fix.
>
> The previous Node JS ring wrapper design has a memory leak issue. It
> is not clear how to avoid memory leak issue when we are attaching a
> function or a class with user data to a Napi::Object. I have reported
> the issue to the Node JS team. They said they are going to fix it from
> the Node JS core side.
>
> Link: https://github.com/nodejs/node-addon-api/issues/1213
> Link: https://github.com/nodejs/node-addon-api/issues/1212
>
> In short, we can't rely on the GC calling the registered finalizers.
>
> For now, redesign the Node JS wrapper to avoid this issue. Use
> a Napi::Number to save the C++ pointer and pass the number as a Node
> JS function argument, then internally cast the number back to C++
> pointer each function call that requires a CHNet pointer interaction.
>
> This design is unsafe, because if the given number argument is not a
> valid pointer, it will lead to undefined behavior. Create a class
> wrapper written in JavaScript to make it safer. The class wrapper also
> adapts the previous object design to minimize breaking changes.
>
> This has been tested with the current unit tests and the result is
> all green.
>
> Please pull!
very good, pulled
tq
-- Viro
prev parent reply other threads:[~2022-10-03 23:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 11:55 [GIT PULL] chnet updates Ammar Faizi
2022-10-03 23:25 ` Alviro Iskandar Setiawan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOG64qPdFAZFK9T1i+sh5MQaDGeeScGwoLk9BsinrtCgKnY6yA@mail.gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox