Search Issue Tracker
Fixed in 4.6.5
[IL2CPP] Marshal.SizeOf dosen't work with types which have an explicitly defined size
1. Deploy the attached project with Il2CPP.
2. Notice the, error:
ArgumentException: Type 'CustomType' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.
at System.Runtime.InteropServices.Marshal.SizeOf (System.Type t) [0x00000] in <filename unknown>:0
at Test..cctor () [0x00000] in <filename unknown>:0
(works fine with mono).
3. Only happens with types which have a StructLayout attribute.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- CIL Linker errors are thrown when building with IL2CPP/WebGL
- Some normal maps has ripple effect and appears to be lower in quality when using default compression settings
- <color=red><></color> does not work with 呸 symbol
- Warning on affected shader count is not thrown when trying to collect shader variants with Async Shader compilation enabled
- Japanese diacritic symbols are missing from the build executable file when building the project