-
Notifications
You must be signed in to change notification settings - Fork 339
calling JsAddRef/JsRelease for data passed to SetEmbedderData #374
calling JsAddRef/JsRelease for data passed to SetEmbedderData #374
Conversation
Is it safe to pass a non-javascript object to |
These lines should "do the right thing" if a non-GC'able pointer is passed into JsAddRef/JsRelease? Let me know if not the case. https://github.com/nodejs/node-chakracore/blob/master/deps/chakrashim/core/lib/Jsrt/Jsrt.cpp#L583-L586 |
Ah yep, looks like |
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.
Will this fix any unit test?
Not sure. How would I know? |
How did you find out this issue? Was there some module that was breaking because of this? |
You opened a bug on it: #97. :) |
Ah, its been a year....Moreover didn't read your PR description. Never mind. |
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.
Kicked off a CI: https://ci.nodejs.org/job/chakracore-test-pull-request/141/ @mike-kaufman We don't use the "Merge pull request" button to merge changes, please sync up with me for the process. |
JS Objects passed to SetEmbedderData need to have JsAddRef/JsRelease called, otherwise they could be GC'd prematurely. Fixes: nodejs#97 PR-URL: nodejs#374 Reviewed-By: Kyle Farnung <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]> Reviewed-By: Kunal Pathak <[email protected]> Reviewed-By: Jimmy Thomson <[email protected]>
4d04cbb
to
5e01643
Compare
JS Objects passed to SetEmbedderData need to have JsAddRef/JsRelease called, otherwise they could be GC'd prematurely. Fixes: nodejs#97 PR-URL: nodejs#374 Reviewed-By: Kyle Farnung <[email protected]> Reviewed-By: Hitesh Kanwathirtha <[email protected]> Reviewed-By: Kunal Pathak <[email protected]> Reviewed-By: Jimmy Thomson <[email protected]>
chakrashim: ref count data sent to SetEmbedderData
JS Objects passed to SetEmbedderData need to have JsAddRef/JsRelease
called, otherwise they could be GC'd prematurely.
Fixes: #97
make -j4 test
(UNIX), orvcbuild test
(Windows) passestests and/or benchmarks are includedN/A - opened Chakra Shim needs unit tests #371 to track getting unit tests up for ChakraShimAffected core subsystem(s)
chakrashim