|
Delta-Wye posted:I usually use the smallest datatype available. If I know a value will fit into a char, I'll use a char, even if I am not particularly memory constrained. That is to say I don't just hold ASCII characters in a char datatype, but use it as a 8-bit integer. Delta-Wye posted:Supposedly this doesn't work very well on a platform like the MSP430. I was told that the 16-bit processors will read a 16-bit value out of memory, mask it to an 8 bit value, do the required operation, then have to mask it again with the contents of memory when storing it. With more confidence I will suggest that <stdint.h> can help here as well. For example, it provides the type "uint_fast8_t", which in theory translates to whatever datatype will store an 8-bit quantity in the most computationally efficient way. In practice you're at the mercy of your compiler vendor. If you don't trust the compiler, you'll have to look at the assembly.
|
# ¿ Jan 21, 2013 00:01 |
|
|
# ¿ Apr 29, 2024 16:50 |
|
No Gravitas posted:C) Does not run on Windows, game over.
|
# ¿ Jul 15, 2014 19:47 |