Uh oh!
There was an error while loading. Please reload this page.
buffer: fix assertion error in WeakCallback - #3329
Conversation
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`, therefore `SPREAD_ARG` will abort with: Assertion failed: ((object)->IsUint8Array()) Make changes necessary to migrate it to `ArrayBuffer`. See: nodejs#3080 (comment)
indutny
commented
Oct 12, 2015
There was a problem hiding this comment.
@TooTallNate has mentioned how some use a zero-length buffer to keep track of things in their modules. A zero-length buffer would be nullptr. Instead should be like:
if (obj_c.Length() > 0) CHECK_NE(obj_data, nullptr);There was a problem hiding this comment.
might want to add a test for this case as well.
trevnorris
commented
Oct 12, 2015
Left 2 comments. Other than that, LGTM |
indutny
commented
Oct 12, 2015
@trevnorris fixed! |
trevnorris
commented
Oct 12, 2015
LGTM |
indutny
commented
Oct 12, 2015
@mikemorris may I ask you to give a try to this patch? Does it fix problem for you? |
mikemorris
commented
Oct 12, 2015
indutny
commented
Oct 12, 2015
Great, thank you for confirming this! cc @jasnell |
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`, therefore `SPREAD_ARG` will abort with: Assertion failed: ((object)->IsUint8Array()) Make changes necessary to migrate it to `ArrayBuffer`. See: #3080 (comment) Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> PR-URL: #3329
jasnell
commented
Oct 13, 2015
Landed in 931118c |
`CallbackInfo` is now bound to `ArrayBuffer` instance, not `Uint8Array`, therefore `SPREAD_ARG` will abort with: Assertion failed: ((object)->IsUint8Array()) Make changes necessary to migrate it to `ArrayBuffer`. See: #3080 (comment) Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> PR-URL: #3329
jasnell
commented
Oct 13, 2015
Landed in v4.x in b3cbd13 |
| slice = null; | ||
| gc(); | ||
| gc(); | ||
| gc(); |
There was a problem hiding this comment.
It's unclear to me why calling gc() three times is required here. @indutny Sorry to pull this up from more than 3 years ago, but do you remember why?
CallbackInfois now bound toArrayBufferinstance, notUint8Array,therefore
SPREAD_ARGwill abort with:Make changes necessary to migrate it to
ArrayBuffer.See: #3080 (comment)
R=@trevnorris