WasmSectionLimits.h 928 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #ifdef ENABLE_WASM
  7. namespace Wasm
  8. {
  9. struct SectionLimits
  10. {
  11. enum Flags : uint32
  12. {
  13. HAS_MAXIMUM = 1 << 0,
  14. };
  15. bool HasMaximum() const { return (flags & HAS_MAXIMUM) != 0; }
  16. Flags flags;
  17. uint32 initial;
  18. uint32 maximum;
  19. };
  20. struct MemorySectionLimits : public SectionLimits
  21. {
  22. enum Flags : uint32
  23. {
  24. IS_SHARED = 1 << 1,
  25. };
  26. bool IsShared() const { return (flags & IS_SHARED) != 0; }
  27. };
  28. struct TableSectionLimits : public SectionLimits
  29. {
  30. // Nothing specific to table section yet
  31. };
  32. }
  33. #endif