question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Boolean values are not blittable

See original GitHub issue

In .NET AFAICT boolean values are 1 byte, whereas in WinRT they are 4 bytes. This probably does not impact most scenarios (e.g. I believe all calling conventions requires “upgrading” all integers less than 32-bits to 32-bits, albeit that’s my recollection of printf, which is a different calling convention, anyway), however it does impact things like arrays, struct sizes, etc. We should probably account for this in the helpers and whatever fallout comes out of that.

FWIW here’s some decent documentation on what is and is not blittable: https://docs.microsoft.com/en-us/dotnet/framework/interop/blittable-and-non-blittable-types

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
kennykerrcommented, Nov 1, 2019

whereas in WinRT they are 4 bytes

That’s not true. WinRT bool values are 1 byte.

0reactions
AaronRobinsonMSFTcommented, Nov 7, 2019

Also note that bool can be marshalled as desired by using UnmanagedType.I1

Read more comments on GitHub >

github_iconTop Results From Across the Web

boolean (Blittable) in IComponentData struct?
According to ms documentation, Boolean is none-blittable data type. Code (CSharp):. https://docs.microsoft.com/en-us/dotnet/ ...
Read more >
Blittable and Non-Blittable Types - .NET Framework
These types are called blittable types because they do not require conversion when they are passed between managed and unmanaged code.
Read more >
Does C# enforce that an `unmanaged` type is "blittable"?
Hans Passant confirmed the answer in the negative. No, simplest counter-example is a struct with a bool field. Never blittable, okay to meet ......
Read more >
Boolean may not be blittable (in C# it's not) · Issue #10
In C#, TestComponent.Blittable is actually a non-blittable struct, due to the Boolean A field. Should move that field to the NonBlittable ...
Read more >
[Unity ECS] Know your blittable types | by 5argon
Blittable types are data types in the Microsoft . ... Not blittable types that maybe not obvious to you includes bool and an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found