src: use predefined AliasedBuffer types in the code base#27334
Closed
joyeecheung wants to merge 1 commit intonodejs:masterfrom
Closed
src: use predefined AliasedBuffer types in the code base#27334joyeecheung wants to merge 1 commit intonodejs:masterfrom
joyeecheung wants to merge 1 commit intonodejs:masterfrom
Conversation
Instead of allowing the callers to instantiate the template with any numeric types (such as aliasing a Uint8Array to double[]), predefine types that make sense and use those instead.
Collaborator
Collaborator
joyeecheung
commented
Apr 21, 2019
| v8::Global<V8T> js_array_; | ||
| }; | ||
|
|
||
| typedef AliasedBufferBase<int32_t, v8::Int32Array> AliasedInt32Array; |
Member
Author
There was a problem hiding this comment.
Another reason for doing this is that it would be easier to implement something like AliasedInt32Array::ForEach() if we add a static list in the case like what we do for the BaseObjects - then we'll be able to iterate over all known aliased buffers in the heap snapshot generator, as well as do bookkeeping for snapshot [de]serialization (we'll record the indexes of the TypedArrays and ArrayBuffers in the snapshot during serialization, and deserialize them into C++ later to keep the states consistent)
addaleax
approved these changes
Apr 21, 2019
jasnell
approved these changes
Apr 25, 2019
Collaborator
joyeecheung
added a commit
that referenced
this pull request
Apr 26, 2019
Instead of allowing the callers to instantiate the template with any numeric types (such as aliasing a Uint8Array to double[]), predefine types that make sense and use those instead. PR-URL: #27334 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
Author
|
Landed in 0ae46a7 |
targos
pushed a commit
that referenced
this pull request
Apr 27, 2019
Instead of allowing the callers to instantiate the template with any numeric types (such as aliasing a Uint8Array to double[]), predefine types that make sense and use those instead. PR-URL: #27334 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
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.
Instead of allowing the callers to instantiate the template
with any numeric types (such as aliasing a Uint8Array to double[]),
predefine types that make sense and use those instead.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes