summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h
index 5f5188d49d..a0fc496cce 100644
--- a/src/env.h
+++ b/src/env.h
@@ -1216,6 +1216,12 @@ class Environment : public MemoryRetainer {
inline AsyncRequest* thread_stopper() { return &thread_stopper_; }
+ // The BaseObject count is a debugging helper that makes sure that there are
+ // no memory leaks caused by BaseObjects staying alive longer than expected
+ // (in particular, no circular BaseObjectPtr references).
+ inline void modify_base_object_count(int64_t delta);
+ inline int64_t base_object_count() const;
+
#if HAVE_INSPECTOR
void set_coverage_connection(
std::unique_ptr<profiler::V8CoverageConnection> connection);
@@ -1427,6 +1433,8 @@ class Environment : public MemoryRetainer {
uint64_t cleanup_hook_counter_ = 0;
bool started_cleanup_ = false;
+ int64_t base_object_count_ = 0;
+
// A custom async abstraction (a pair of async handle and a state variable)
// Used by embedders to shutdown running Node instance.
AsyncRequest thread_stopper_;