@@ -27,6 +27,7 @@ using v8::Array;
2727using v8::ArrayBuffer;
2828using v8::ArrayBufferView;
2929using v8::BackingStore;
30+ using v8::BackingStoreInitializationMode;
3031using v8::Boolean;
3132using v8::Context;
3233using v8::EscapableHandleScope;
@@ -292,11 +293,10 @@ Local<Value> Http2Settings::Pack(
292293 size_t count,
293294 const nghttp2_settings_entry* entries) {
294295 EscapableHandleScope scope (env->isolate ());
295- std::unique_ptr<BackingStore> bs;
296- {
297- NoArrayBufferZeroFillScope no_zero_fill_scope (env->isolate_data ());
298- bs = ArrayBuffer::NewBackingStore (env->isolate (), count * 6 );
299- }
296+ std::unique_ptr<BackingStore> bs = ArrayBuffer::NewBackingStore (
297+ env->isolate (),
298+ count * 6 ,
299+ BackingStoreInitializationMode::kUninitialized );
300300 if (nghttp2_pack_settings_payload (static_cast <uint8_t *>(bs->Data ()),
301301 bs->ByteLength (),
302302 entries,
@@ -457,13 +457,11 @@ Origins::Origins(
457457 return ;
458458 }
459459
460- {
461- NoArrayBufferZeroFillScope no_zero_fill_scope (env->isolate_data ());
462- bs_ = ArrayBuffer::NewBackingStore (env->isolate (),
463- alignof (nghttp2_origin_entry) - 1 +
464- count_ * sizeof (nghttp2_origin_entry) +
465- origin_string_len);
466- }
460+ bs_ = ArrayBuffer::NewBackingStore (
461+ env->isolate (),
462+ alignof (nghttp2_origin_entry) - 1 +
463+ count_ * sizeof (nghttp2_origin_entry) + origin_string_len,
464+ BackingStoreInitializationMode::kUninitialized );
467465
468466 // Make sure the start address is aligned appropriately for an nghttp2_nv*.
469467 char * start = nbytes::AlignUp (static_cast <char *>(bs_->Data ()),
@@ -2064,12 +2062,10 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf_) {
20642062 // happen, we concatenate the data we received with the already-stored
20652063 // pending input data, slicing off the already processed part.
20662064 size_t pending_len = stream_buf_.len - stream_buf_offset_;
2067- std::unique_ptr<BackingStore> new_bs;
2068- {
2069- NoArrayBufferZeroFillScope no_zero_fill_scope (env ()->isolate_data ());
2070- new_bs = ArrayBuffer::NewBackingStore (env ()->isolate (),
2071- pending_len + nread);
2072- }
2065+ std::unique_ptr<BackingStore> new_bs = ArrayBuffer::NewBackingStore (
2066+ env ()->isolate (),
2067+ pending_len + nread,
2068+ BackingStoreInitializationMode::kUninitialized );
20732069 memcpy (static_cast <char *>(new_bs->Data ()),
20742070 stream_buf_.base + stream_buf_offset_,
20752071 pending_len);
0 commit comments