Why int take less space in memory than bool? #12184
PixelTim
started this conversation in
Engine Core
Replies: 1 comment 6 replies
-
It's not. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I know, both bool and int are extending Variant type, and variant type is 20 bytes (160 bits). But int takes only 64 bits (8 bytes) despite being a Variant. If it is possible to change size of Variant, then why bool is stored in 160 bits (like common Variant), but not in 1 bit or 1 byte at least.
Side question: is it better to use ints instead of bools (ints take less memory space)?
Beta Was this translation helpful? Give feedback.
All reactions