Coverage Report

Created: 2025-12-30 08:42

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/node/src/cppgc_helpers.cc
Line
Count
Source
1
#include "cppgc_helpers.h"
2
#include "env-inl.h"
3
4
namespace node {
5
6
35
void CppgcWrapperList::Cleanup() {
7
35
  for (auto node : *this) {
8
0
    CppgcMixin* ptr = node->persistent.Get();
9
0
    if (ptr != nullptr) {
10
0
      ptr->Finalize();
11
0
    }
12
0
  }
13
35
}
14
15
0
void CppgcWrapperList::MemoryInfo(MemoryTracker* tracker) const {
16
0
  for (auto node : *this) {
17
0
    CppgcMixin* ptr = node->persistent.Get();
18
0
    if (ptr != nullptr) {
19
0
      tracker->Track(ptr);
20
0
    }
21
0
  }
22
0
}
23
24
0
void CppgcWrapperList::PurgeEmpty() {
25
0
  for (auto weak_it = begin(); weak_it != end();) {
26
0
    CppgcWrapperListNode* node = *weak_it;
27
0
    auto next_it = ++weak_it;
28
    // The underlying cppgc wrapper has already been garbage collected.
29
    // Remove it from the list.
30
0
    if (!node->persistent) {
31
0
      node->persistent.Clear();
32
0
      delete node;
33
0
    }
34
0
    weak_it = next_it;
35
0
  }
36
0
}
37
}  // namespace node