FieldLayout.h 783 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include <stdint.h>
  3. #include <vector>
  4. #include "metadata/Il2CppTypeVector.h"
  5. namespace il2cpp
  6. {
  7. namespace metadata
  8. {
  9. struct SizeAndAlignment
  10. {
  11. size_t size;
  12. uint8_t alignment;
  13. };
  14. class FieldLayout
  15. {
  16. public:
  17. struct FieldLayoutData
  18. {
  19. std::vector<size_t> FieldOffsets;
  20. size_t classSize;
  21. size_t actualClassSize;
  22. uint8_t minimumAlignment;
  23. };
  24. static void LayoutFields(size_t parentSize, size_t actualParentSize, size_t parentAlignment, uint8_t packing, const Il2CppTypeVector& fieldTypes, FieldLayoutData& data);
  25. static SizeAndAlignment GetTypeSizeAndAlignment(const Il2CppType* type);
  26. };
  27. } /* namespace metadata */
  28. } /* namespace il2cpp */