buffer: FreeCallback should be tied to ArrayBuffer#3198
Closed
indutny wants to merge 1 commit intonodejs:masterfrom
Closed
buffer: FreeCallback should be tied to ArrayBuffer#3198indutny wants to merge 1 commit intonodejs:masterfrom
indutny wants to merge 1 commit intonodejs:masterfrom
Conversation
Member
Author
|
@bnoordhuis I wonder if it may be a good opportunity to write our first C++ test. |
21c3543 to
1ce1e17
Compare
Member
Author
|
Nah, gtest didn't work out. It was simpler to just write an test addon. |
Contributor
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?
Member
Author
There was a problem hiding this comment.
idk, seems to be a legit use of RequestGC here
Contributor
|
LGTM. Does CI run these tests? |
Member
There was a problem hiding this comment.
Can I suggest you make this a counter and check that it's > 0 in FreeCallback?
Member
|
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 <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
1ce1e17 to
9d4063e
Compare
Member
Author
|
All fixed and rebased. Running CI. |
Member
Author
Member
Author
|
Landed in d1f2404, please backport to v4.x |
indutny
added a commit
that referenced
this pull request
Oct 6, 2015
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 <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
indutny
added a commit
that referenced
this pull request
Oct 8, 2015
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 <info@bnoordhuis.nl> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Contributor
|
landed in v4.x-staging in 660f759 |
This was referenced Nov 30, 2023
This was referenced Nov 30, 2023
This was referenced Nov 30, 2023
This was referenced Dec 1, 2023
This was referenced Dec 1, 2023
This was referenced Dec 2, 2023
This was referenced Dec 2, 2023
This was referenced Dec 2, 2023
This was referenced Dec 2, 2023
This was referenced Dec 3, 2023
This was referenced Dec 4, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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