RuntimeConfig.h 859 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "CommonDef.h"
  3. namespace hybridclr
  4. {
  5. enum class RuntimeOptionId
  6. {
  7. InterpreterThreadObjectStackSize = 1,
  8. InterpreterThreadFrameStackSize = 2,
  9. InterpreterThreadExceptionFlowSize = 3,
  10. };
  11. class RuntimeConfig
  12. {
  13. public:
  14. static int32_t GetRuntimeOption(RuntimeOptionId optionId);
  15. static void SetRuntimeOption(RuntimeOptionId optionId, int32_t value);
  16. static uint32_t GetInterpreterThreadObjectStackSize()
  17. {
  18. return (uint32_t)GetRuntimeOption(RuntimeOptionId::InterpreterThreadObjectStackSize);
  19. }
  20. static uint32_t GetInterpreterThreadFrameStackSize()
  21. {
  22. return (uint32_t)GetRuntimeOption(RuntimeOptionId::InterpreterThreadFrameStackSize);
  23. }
  24. static uint32_t GetInterpreterThreadExceptionFlowSize()
  25. {
  26. return (uint32_t)GetRuntimeOption(RuntimeOptionId::InterpreterThreadExceptionFlowSize);
  27. }
  28. };
  29. }