Skip to content

Commit 3b2bbbd

Browse files
addaleaxcodebytere
authored andcommitted
src: allow unique_ptrs with custom deleter in memory tracker
Originally landed in the QUIC repo Original review metadata: ``` PR-URL: nodejs/quic#145 Reviewed-By: James M Snell <[email protected]> ``` PR-URL: #31870 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 9ab4a7e commit 3b2bbbd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/memory_tracker-inl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ void MemoryTracker::TrackField(const char* edge_name,
9999
}
100100
}
101101

102-
template <typename T>
102+
template <typename T, typename D>
103103
void MemoryTracker::TrackField(const char* edge_name,
104-
const std::unique_ptr<T>& value,
104+
const std::unique_ptr<T, D>& value,
105105
const char* node_name) {
106106
if (value.get() == nullptr) {
107107
return;

src/memory_tracker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ class MemoryTracker {
134134
size_t size,
135135
const char* node_name = nullptr);
136136
// Shortcut to extract the underlying object out of the smart pointer
137-
template <typename T>
137+
template <typename T, typename D>
138138
inline void TrackField(const char* edge_name,
139-
const std::unique_ptr<T>& value,
139+
const std::unique_ptr<T, D>& value,
140140
const char* node_name = nullptr);
141141

142142
// For containers, the elements will be graphed as grandchildren nodes

0 commit comments

Comments
 (0)