VmThreadUtils.h 601 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "il2cpp-config.h"
  3. enum Il2CppStackPointerResult
  4. {
  5. Il2CppStackPointerNotSupported = -1,
  6. Il2CppStackPointerIsNotOnStack = 0,
  7. Il2CppStackPointerIsOnStack = 1,
  8. };
  9. namespace il2cpp
  10. {
  11. namespace utils
  12. {
  13. class LIBIL2CPP_CODEGEN_API VmThreadUtils
  14. {
  15. public:
  16. static Il2CppStackPointerResult PointerIsOnCurrentThreadStack(void* ptr);
  17. };
  18. } // namespace utils
  19. } // namespace il2cpp
  20. #define IL2CPP_ASSERT_STACK_PTR(ptr) IL2CPP_ASSERT(ptr != NULL && il2cpp::utils::VmThreadUtils::PointerIsOnCurrentThreadStack(ptr) != Il2CppStackPointerIsNotOnStack)