I don’t know much about the registry file format or the Windows APIs, but it’s possible that smaller data types wouldn’t save space due to alignment requirements for the datastructures.
Using more than one bit for true/false isn’t just a microsoft thing, and not really as ridiculous as it sounds. Memory isn’t addessable by bits, but by bytes. You can either:
Do it like the example here.
Use bitfields: Pack multiple values into the same address, but “waste” more memory and cpu time for keeping track and checking which bit your bool is in. This is mostly useful when the data itself has to be really small.
Why is it 32bit / 4 bytes instead of one? I assume a byte alignment reason because of some optimization.
Gotta love Microsoft. “We need this to store either a 0 or a 1. How many bits should we take up, boss?”
32.
It looks to be the smallest supported integer type: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rprn/25cce700-7fcf-4bb6-a2f3-0f6d08430a55
I don’t know much about the registry file format or the Windows APIs, but it’s possible that smaller data types wouldn’t save space due to alignment requirements for the datastructures.
Using more than one bit for true/false isn’t just a microsoft thing, and not really as ridiculous as it sounds. Memory isn’t addessable by bits, but by bytes. You can either:
Why is it 32bit / 4 bytes instead of one? I assume a byte alignment reason because of some optimization.
I bet the person who decided to store gender as a 32 bit value instead of a single bit is feeling utterly proud of his foresight right now.