how many bytes is a DWORD? can't find any references.
how many bytes is a DWORD? can't find any references.
-"What we wish, we readily believe, and what we ourselves think, we imagine others think also."PHP Code:
sadf
8 bits = 1 byte
16 bits = 1 word (2 bytes)
so (assuming I'm right so far ) a dword is 4 bytes.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
that's right. that's what I thought, I'll use short from now on, which is 2 bytes thanks.
-"What we wish, we readily believe, and what we ourselves think, we imagine others think also."PHP Code:
sadf
DWORD lines up with the architecture of your CPU better. Each fetch in the computer (assuming a 32-bit CPU running in protected mode) is 32-bits so a WORD wastes 16 bits on every fetch. Check your compiler documentation and options to both understand and change the alignment.
Ohhh, I believe I understand from your post. Thanks Bubba, no more shortsOriginally Posted by Bubba
-"What we wish, we readily believe, and what we ourselves think, we imagine others think also."PHP Code:
sadf
Nah I'm not saying never use smaller data types. Use what works - or more appropriately what data type fits the task at hand.
But your compiler has an alignment option which allows you to set the data alignment of your code, stack, and data. This means that if you set the alignment to line up better with the memory fetches then your code will be somewhat faster. Not a complete guarantee but most of the time this holds true.
Wow, that's awesome. I'll definitely google that later. Thanks man
-"What we wish, we readily believe, and what we ourselves think, we imagine others think also."PHP Code:
sadf