diff --git a/mesosphere/include/mesosphere/kresources/KObjectAllocator.hpp b/mesosphere/include/mesosphere/kresources/KObjectAllocator.hpp index 906d0e4c5..a26faef7b 100644 --- a/mesosphere/include/mesosphere/kresources/KObjectAllocator.hpp +++ b/mesosphere/include/mesosphere/kresources/KObjectAllocator.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include #include @@ -17,6 +18,14 @@ class KObjectAllocator { } }; + + struct ComparatorEqual { + constexpr u64 operator()(const T &val) const + { + return val.GetComparisonKey(); + } + }; + public: struct HookTag; @@ -29,6 +38,7 @@ class KObjectAllocator { T, boost::intrusive::base_hook, boost::intrusive::compare + //boost::intrusive::key_of_value >::type; using pointer = T *; @@ -61,6 +71,12 @@ class KObjectAllocator { allocatedSet.erase(obj); } + T *FindObject(u64 comparisonKey) + { + auto it = allocatedSet.find(comparisonKey, ComparatorEqual{}); + return it != allocatedSet.end() ? &*it : nullptr; + } + private: AllocatedSetType allocatedSet{}; KSlabHeap slabHeap{}; diff --git a/mesosphere/include/mesosphere/processes/KEvent.hpp b/mesosphere/include/mesosphere/processes/KEvent.hpp index 3559710a9..16891c1b5 100644 --- a/mesosphere/include/mesosphere/processes/KEvent.hpp +++ b/mesosphere/include/mesosphere/processes/KEvent.hpp @@ -2,7 +2,6 @@ #include #include -#include #include #include #include diff --git a/mesosphere/include/mesosphere/processes/KWritableEvent.hpp b/mesosphere/include/mesosphere/processes/KWritableEvent.hpp index e57d79c77..a2e0ad2f4 100644 --- a/mesosphere/include/mesosphere/processes/KWritableEvent.hpp +++ b/mesosphere/include/mesosphere/processes/KWritableEvent.hpp @@ -2,7 +2,6 @@ #include #include -#include #include #include