diff options
author | Gireesh Punathil <gpunathi@in.ibm.com> | 2019-02-18 06:14:41 -0500 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2019-02-28 10:02:33 +0530 |
commit | 17b4949a84106d70749106985f6d606004acf25a (patch) | |
tree | 04758b34879c3343b6f8e34e62b75e0b442c3da3 /src/memory_tracker.h | |
parent | df43754fe1bf70042ae364f2365b42271468f102 (diff) | |
download | node-new-17b4949a84106d70749106985f6d606004acf25a.tar.gz |
src: track memory retainer fields
If retainers are embedded in retainers, direct tracking
those lead to double tracking. Instead, use a special tracker
that adjusts the tracking for the container object.
PR-URL: https://github.com/nodejs/node/pull/26161
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/memory_tracker.h')
-rw-r--r-- | src/memory_tracker.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/memory_tracker.h b/src/memory_tracker.h index 11dd2be7af..673cd811c3 100644 --- a/src/memory_tracker.h +++ b/src/memory_tracker.h @@ -197,6 +197,17 @@ class MemoryTracker { inline void Track(const MemoryRetainer* retainer, const char* edge_name = nullptr); + // Useful for parents that do not wish to perform manual + // adjustments to its `SelfSize()` when embedding retainer + // objects inline. + // Put a memory container into the graph, create an edge from + // the current node if there is one on the stack - there should + // be one, of the container object which the current field is part of. + // Reduce the size of memory from the container so as to avoid + // duplication in accounting. + inline void TrackInlineField(const MemoryRetainer* retainer, + const char* edge_name = nullptr); + inline v8::EmbedderGraph* graph() { return graph_; } inline v8::Isolate* isolate() { return isolate_; } |