buffer: FreeCallback should be tied to ArrayBuffer#3198
buffer: FreeCallback should be tied to ArrayBuffer#3198indutny wants to merge 1 commit intonodejs:masterfrom
Conversation
|
@bnoordhuis I wonder if it may be a good opportunity to write our first C++ test. |
21c3543 to
1ce1e17
Compare
|
Nah, gtest didn't work out. It was simpler to just write an test addon. |
There was a problem hiding this comment.
Out of curiosity, is it viable to use a technique similar to https://groups.google.com/d/msg/v8-users/JmhzmswiqvM/IC6UtV5FEC4J so that --expose-gc doesn't have to be passed?
There was a problem hiding this comment.
idk, seems to be a legit use of RequestGC here
|
LGTM. Does CI run these tests? |
There was a problem hiding this comment.
Can I suggest you make this a counter and check that it's > 0 in FreeCallback?
|
LGTM |
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`), not when the view (`Uint8Array` or `Buffer`) is disposed. This causes bug and crashes in addons which create buffers and store only slices of them. PR-URL: nodejs#3198 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
1ce1e17 to
9d4063e
Compare
|
All fixed and rebased. Running CI. |
|
Landed in d1f2404, please backport to v4.x |
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`), not when the view (`Uint8Array` or `Buffer`) is disposed. This causes bug and crashes in addons which create buffers and store only slices of them. PR-URL: #3198 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
FreeCallback should be invoked on the storage disposal (`ArrayBuffer`), not when the view (`Uint8Array` or `Buffer`) is disposed. This causes bug and crashes in addons which create buffers and store only slices of them. PR-URL: #3198 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
|
landed in v4.x-staging in 660f759 |
FreeCallback should be invoked on the storage disposal (
ArrayBuffer),not when the view (
Uint8ArrayorBuffer) is disposed. This causesbug and crashes in addons which create buffers and store only slices of
them.
cc @trevnorris @bnoordhuis @nodejs/collaborators