diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-25 04:12:19 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-03-01 21:57:54 +0100 |
commit | 31975bbc88d353cf2eecc93c9d2cde62dba67b2c (patch) | |
tree | 7a91545cfd50182e50addd1aa3a6468d74f65474 /src/node_http2.h | |
parent | b42dcb0eeb2d2c302b0ecabbc1092605a54213d6 (diff) | |
download | node-new-31975bbc88d353cf2eecc93c9d2cde62dba67b2c.tar.gz |
src: allow not materializing ArrayBuffers from C++
Where appropriate, use a helper that wraps around
`ArrayBufferView::Buffer()` or `ArrayBufferView::CopyContents()`
rather than `Buffer::Data()`, as that may help to avoid materializing
the underlying `ArrayBuffer` when reading small typed arrays from C++.
This allows keeping the performance benefits of the faster creation of
heap-allocated small typed arrays in many cases.
PR-URL: https://github.com/nodejs/node/pull/26301
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_http2.h')
-rw-r--r-- | src/node_http2.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node_http2.h b/src/node_http2.h index 9065718c60..8a8ef74af9 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -699,7 +699,8 @@ class Http2Session : public AsyncWrap, public StreamListener { void Close(uint32_t code = NGHTTP2_NO_ERROR, bool socket_closed = false); void Consume(Local<External> external); - void Goaway(uint32_t code, int32_t lastStreamID, uint8_t* data, size_t len); + void Goaway(uint32_t code, int32_t lastStreamID, + const uint8_t* data, size_t len); void AltSvc(int32_t id, uint8_t* origin, size_t origin_len, @@ -1089,7 +1090,7 @@ class Http2Session::Http2Ping : public AsyncWrap { SET_MEMORY_INFO_NAME(Http2Ping) SET_SELF_SIZE(Http2Ping) - void Send(uint8_t* payload); + void Send(const uint8_t* payload); void Done(bool ack, const uint8_t* payload = nullptr); private: |