src: correctly report memory changes to V8 · nodejs/node@bcb29fb

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -59,7 +59,7 @@ void* NgLibMemoryManager<Class, T>::ReallocImpl(void* ptr,

5959

// Environment*/Isolate* parameter and call the V8 method transparently.

6060

const int64_t new_size = size - previous_size;

6161

manager->IncreaseAllocatedSize(new_size);

62-

manager->env()->external_memory_accounter()->Increase(

62+

manager->env()->external_memory_accounter()->Update(

6363

manager->env()->isolate(), new_size);

6464

*reinterpret_cast<size_t*>(mem) = size;

6565

mem += sizeof(size_t);

Original file line numberDiff line numberDiff line change

@@ -644,7 +644,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork {

644644

if (report == 0) return;

645645

CHECK_IMPLIES(report < 0, zlib_memory_ >= static_cast<size_t>(-report));

646646

zlib_memory_ += report;

647-

AsyncWrap::env()->external_memory_accounter()->Increase(

647+

AsyncWrap::env()->external_memory_accounter()->Update(

648648

AsyncWrap::env()->isolate(), report);

649649

}

650650