Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

Commit

Permalink
src: allow unique_ptrs with custom deleter in memory tracker
Browse files Browse the repository at this point in the history
PR-URL: #145
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and jasnell committed Oct 3, 2019
1 parent a529ed5 commit 7f6cbf2
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,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
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ class MemoryTracker {
size_t size,
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, bool kIsWeak>
void TrackField(const char* edge_name,
Expand Down

0 comments on commit 7f6cbf2

Please sign in to comment.