Skip to content

Commit

Permalink
src: allow unique_ptrs with custom deleter in memory tracker
Browse files Browse the repository at this point in the history
Originally landed in the QUIC repo

Original review metadata:

```
  PR-URL: nodejs/quic#145
  Reviewed-By: James M Snell <jasnell@gmail.com>
```

PR-URL: #31870
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
addaleax authored and codebytere committed Feb 27, 2020
1 parent 88ccb44 commit 8fa6373
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/memory_tracker-inl.h
Expand Up @@ -107,9 +107,9 @@ void MemoryTracker::TrackField(const char* edge_name,
}
}

template <typename T>
template <typename T, typename D>
void MemoryTracker::TrackField(const char* edge_name,
const std::unique_ptr<T>& value,
const std::unique_ptr<T, D>& value,
const char* node_name) {
if (value.get() == nullptr) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/memory_tracker.h
Expand Up @@ -140,9 +140,9 @@ class MemoryTracker {
const char* node_name = nullptr);

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

template <typename T>
Expand Down

0 comments on commit 8fa6373

Please sign in to comment.