15 #ifndef SHAKA_EMBEDDED_MEMORY_OBJECT_TRACKER_H_ 16 #define SHAKA_EMBEDDED_MEMORY_OBJECT_TRACKER_H_ 18 #include <glog/logging.h> 21 #include <unordered_map> 22 #include <unordered_set> 36 class ClearKeyImplementationTest;
71 std::unordered_set<const Traceable*> GetAliveObjects()
const;
77 void FreeDeadObjects(
const std::unordered_set<const Traceable*>& alive);
84 friend class ObjectTrackerTest;
90 uint32_t GetRefCount(
Traceable*
object)
const;
92 void DestroyObjects(
const std::unordered_set<Traceable*>& to_delete,
93 std::unique_lock<Mutex>* lock);
98 std::unordered_map<Traceable*, uint32_t> objects_;
99 std::unordered_map<Traceable*, uint64_t> last_alive_time_;
100 std::unordered_set<Traceable*> to_delete_;
106 #endif // SHAKA_EMBEDDED_MEMORY_OBJECT_TRACKER_H_
#define SHAKA_NON_COPYABLE_OR_MOVABLE_TYPE(Type)