Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! http2: report memory allocated by nghttp2 to V8
  • Loading branch information
addaleax committed Jul 14, 2019
commit d34c8610aad1d6ed6f9812a787f3e776d959ef31
5 changes: 3 additions & 2 deletions src/node_http2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,10 @@ class Http2Session::MemoryAllocatorInfo {
// current_nghttp2_memory_ + AdjustAmountOfExternalAllocatedMemory
// and provide versions of our memory allocation utilities that take an
// Environment*/Isolate* parameter and call the V8 method transparently.
session->current_nghttp2_memory_ += size - previous_size;
const int64_t new_size = size - previous_size;
session->current_nghttp2_memory_ += new_size;
session->env()->isolate()->AdjustAmountOfExternalAllocatedMemory(
static_cast<int64_t>(size - previous_size));
new_size);
*reinterpret_cast<size_t*>(mem) = size;
mem += sizeof(size_t);
} else if (size == 0) {
Expand Down