Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-10-22 23:03:53 +0300
committerMichaƫl Zasso <targos@protonmail.com>2019-11-08 17:53:36 +0300
commit2bdeb88c27b4d8de3a8f6b7a438cf0bcb88fa927 (patch)
treec86c4faa4410216460c25053ab22061ee3f9897f /src/memory_tracker.h
parent2707efd27b5ce5f9b9a6873438769394ef1c6431 (diff)
src: remove custom tracking for SharedArrayBuffers
Remove custom tracking for `SharedArrayBuffer`s and their allocators and instead let V8 do the tracking of both. This is required starting in V8 7.9, because lifetime management for `ArrayBuffer::Allocator`s differs from what was performed previously (i.e. it is no longer easily possible for one Isolate to release an `ArrayBuffer` and another to accept it into its own allocator), and the alternative would have been adapting the `SharedArrayBuffer` tracking logic to also apply to regular `ArrayBuffer` instances. Refs: https://github.com/nodejs/node/pull/30044 PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/memory_tracker.h')
-rw-r--r--src/memory_tracker.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/memory_tracker.h b/src/memory_tracker.h
index d22116918af..3bcbe97c99c 100644
--- a/src/memory_tracker.h
+++ b/src/memory_tracker.h
@@ -138,6 +138,10 @@ class MemoryTracker {
inline void TrackField(const char* edge_name,
const std::unique_ptr<T>& value,
const char* node_name = nullptr);
+ template <typename T>
+ inline void TrackField(const char* edge_name,
+ const std::shared_ptr<T>& value,
+ const char* node_name = nullptr);
// For containers, the elements will be graphed as grandchildren nodes
// if the container is not empty.
@@ -197,6 +201,9 @@ class MemoryTracker {
inline void TrackField(const char* edge_name,
const MallocedBuffer<T>& value,
const char* node_name = nullptr);
+ inline void TrackField(const char* edge_name,
+ const v8::BackingStore* value,
+ const char* node_name = nullptr);
// We do not implement CleanupHookCallback as MemoryRetainer
// but instead specialize the method here to avoid the cost of
// virtual pointers.