Skip to content

Commit 8fa6373

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 88ccb44 commit 8fa6373

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/memory_tracker-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ void MemoryTracker::TrackField(const char* edge_name,
107107
}
108108
}
109109

110-
template <typename T>
110+
template <typename T, typename D>
111111
void MemoryTracker::TrackField(const char* edge_name,
112-
const std::unique_ptr<T>& value,
112+
const std::unique_ptr<T, D>& value,
113113
const char* node_name) {
114114
if (value.get() == nullptr) {
115115
return;

src/memory_tracker.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ class MemoryTracker {
140140
const char* node_name = nullptr);
141141

142142
// Shortcut to extract the underlying object out of the smart pointer
143-
template <typename T>
143+
template <typename T, typename D>
144144
inline void TrackField(const char* edge_name,
145-
const std::unique_ptr<T>& value,
145+
const std::unique_ptr<T, D>& value,
146146
const char* node_name = nullptr);
147147

148148
template <typename T>

0 commit comments

Comments
 (0)