NativeDelegateMethodCache.h 697 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "il2cpp-api-types.h"
  3. #include "il2cpp-vm-support.h"
  4. #include <map>
  5. #include "Baselib.h"
  6. #include "Cpp/ReentrantLock.h"
  7. namespace il2cpp
  8. {
  9. namespace utils
  10. {
  11. typedef std::map<Il2CppMethodPointer, const VmMethod*> NativeDelegateMap;
  12. class NativeDelegateMethodCache
  13. {
  14. public:
  15. static const VmMethod* GetNativeDelegate(Il2CppMethodPointer nativeFunctionPointer);
  16. static void AddNativeDelegate(Il2CppMethodPointer nativeFunctionPointer, const VmMethod* managedMethodInfo);
  17. private:
  18. static baselib::ReentrantLock m_CacheMutex;
  19. static NativeDelegateMap m_NativeDelegateMethods;
  20. };
  21. } // namespace utils
  22. } // namespace il2cpp