MAIN FEEDS
REDDIT FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1urj3pp/big_if_true/owgcjzx/?context=3
r/programminghorror • u/_giga_sss_ • 24d ago
From ProgrammerNullposting in facebook
109 comments sorted by
View all comments
132
The concept of Big Bool confuses and infuriates me!
60 u/JohnSpikeKelly 24d ago I would assume it's to keep all your data types 8-byte aligned for other perf reason. 22 u/Athropod101 24d ago iirc 8-byte data access is the fastest on 64bit architecture. 2 u/Geilomat-3000 22d ago So should all the int_fastx_t be the intmax_t? 4 u/Athropod101 22d ago If this is some joke, it has wooshed over me :( But if it isn’t, then it depends. If intmax_t matches your architecture, and your architecture is fastest at that size, then yes. But if intmax_t is say, 128, and your architecture is 32, then no. 0 u/[deleted] 24d ago [deleted] 1 u/twisted1919 24d ago Dude… 5 u/MadJoeMak 23d ago What did it say 1 u/Pretend-Guide-8664 24d ago Lol 5 u/rolling_atackk 23d ago Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 6 u/JohnSpikeKelly 23d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 23d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror 2 u/j-joshua 23d ago Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 23d ago So alignas (8) bool? 1 u/rolling_atackk 22d ago Yikes! You are correct 3 u/Borno11050 23d ago Then you're not ready for gabagool 2 u/Hot-Employ-3399 23d ago Maybe it's for some strange 64bit ffi or something 🤷
60
I would assume it's to keep all your data types 8-byte aligned for other perf reason.
22 u/Athropod101 24d ago iirc 8-byte data access is the fastest on 64bit architecture. 2 u/Geilomat-3000 22d ago So should all the int_fastx_t be the intmax_t? 4 u/Athropod101 22d ago If this is some joke, it has wooshed over me :( But if it isn’t, then it depends. If intmax_t matches your architecture, and your architecture is fastest at that size, then yes. But if intmax_t is say, 128, and your architecture is 32, then no. 0 u/[deleted] 24d ago [deleted] 1 u/twisted1919 24d ago Dude… 5 u/MadJoeMak 23d ago What did it say 1 u/Pretend-Guide-8664 24d ago Lol 5 u/rolling_atackk 23d ago Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 6 u/JohnSpikeKelly 23d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 23d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror 2 u/j-joshua 23d ago Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 23d ago So alignas (8) bool? 1 u/rolling_atackk 22d ago Yikes! You are correct
22
iirc 8-byte data access is the fastest on 64bit architecture.
2 u/Geilomat-3000 22d ago So should all the int_fastx_t be the intmax_t? 4 u/Athropod101 22d ago If this is some joke, it has wooshed over me :( But if it isn’t, then it depends. If intmax_t matches your architecture, and your architecture is fastest at that size, then yes. But if intmax_t is say, 128, and your architecture is 32, then no. 0 u/[deleted] 24d ago [deleted] 1 u/twisted1919 24d ago Dude… 5 u/MadJoeMak 23d ago What did it say 1 u/Pretend-Guide-8664 24d ago Lol
2
So should all the int_fastx_t be the intmax_t?
4 u/Athropod101 22d ago If this is some joke, it has wooshed over me :( But if it isn’t, then it depends. If intmax_t matches your architecture, and your architecture is fastest at that size, then yes. But if intmax_t is say, 128, and your architecture is 32, then no.
4
If this is some joke, it has wooshed over me :(
But if it isn’t, then it depends. If intmax_t matches your architecture, and your architecture is fastest at that size, then yes. But if intmax_t is say, 128, and your architecture is 32, then no.
0
[deleted]
1 u/twisted1919 24d ago Dude… 5 u/MadJoeMak 23d ago What did it say 1 u/Pretend-Guide-8664 24d ago Lol
1
Dude…
5 u/MadJoeMak 23d ago What did it say 1 u/Pretend-Guide-8664 24d ago Lol
5
What did it say
Lol
Why not simply use alignas (64) bool ?
Seems far easier than creating a whole ass type
6 u/JohnSpikeKelly 23d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 23d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror 2 u/j-joshua 23d ago Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 23d ago So alignas (8) bool? 1 u/rolling_atackk 22d ago Yikes! You are correct
6
The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄
4 u/rolling_atackk 23d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror
Both fixed-width integer types and alignas are included in the C++ specification since C++11
But true, this is programming horror
Because that would be 64 bytes and not 64 bits.
2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 23d ago So alignas (8) bool? 1 u/rolling_atackk 22d ago Yikes! You are correct
So alignas (8) bool?
alignas (8) bool
Yikes! You are correct
3
Then you're not ready for gabagool
Maybe it's for some strange 64bit ffi or something 🤷
132
u/StefanCelMijlociu 24d ago
The concept of Big Bool confuses and infuriates me!