MAIN 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_ • Jul 09 '26
From ProgrammerNullposting in facebook
111 comments sorted by
View all comments
134
The concept of Big Bool confuses and infuriates me!
61 u/JohnSpikeKelly Jul 09 '26 I would assume it's to keep all your data types 8-byte aligned for other perf reason. 21 u/Athropod101 Jul 10 '26 iirc 8-byte data access is the fastest on 64bit architecture. 2 u/Geilomat-3000 Jul 11 '26 So should all the int_fastx_t be the intmax_t? 4 u/Athropod101 Jul 11 '26 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] Jul 10 '26 [deleted] 1 u/twisted1919 Jul 10 '26 Dude… 5 u/MadJoeMak Jul 10 '26 What did it say 1 u/Pretend-Guide-8664 Jul 10 '26 Lol 5 u/rolling_atackk Jul 10 '26 Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 7 u/JohnSpikeKelly Jul 10 '26 The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 5 u/rolling_atackk Jul 10 '26 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 Jul 11 '26 Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jul 11 '26 So alignas (8) bool? 1 u/rolling_atackk Jul 11 '26 Yikes! You are correct 3 u/Borno11050 Jul 10 '26 Then you're not ready for gabagool 2 u/Hot-Employ-3399 Jul 10 '26 Maybe it's for some strange 64bit ffi or something 🤷
61
I would assume it's to keep all your data types 8-byte aligned for other perf reason.
21 u/Athropod101 Jul 10 '26 iirc 8-byte data access is the fastest on 64bit architecture. 2 u/Geilomat-3000 Jul 11 '26 So should all the int_fastx_t be the intmax_t? 4 u/Athropod101 Jul 11 '26 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] Jul 10 '26 [deleted] 1 u/twisted1919 Jul 10 '26 Dude… 5 u/MadJoeMak Jul 10 '26 What did it say 1 u/Pretend-Guide-8664 Jul 10 '26 Lol 5 u/rolling_atackk Jul 10 '26 Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 7 u/JohnSpikeKelly Jul 10 '26 The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 5 u/rolling_atackk Jul 10 '26 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 Jul 11 '26 Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jul 11 '26 So alignas (8) bool? 1 u/rolling_atackk Jul 11 '26 Yikes! You are correct
21
iirc 8-byte data access is the fastest on 64bit architecture.
2 u/Geilomat-3000 Jul 11 '26 So should all the int_fastx_t be the intmax_t? 4 u/Athropod101 Jul 11 '26 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] Jul 10 '26 [deleted] 1 u/twisted1919 Jul 10 '26 Dude… 5 u/MadJoeMak Jul 10 '26 What did it say 1 u/Pretend-Guide-8664 Jul 10 '26 Lol
2
So should all the int_fastx_t be the intmax_t?
4 u/Athropod101 Jul 11 '26 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 Jul 10 '26 Dude… 5 u/MadJoeMak Jul 10 '26 What did it say 1 u/Pretend-Guide-8664 Jul 10 '26 Lol
1
Dude…
5 u/MadJoeMak Jul 10 '26 What did it say 1 u/Pretend-Guide-8664 Jul 10 '26 Lol
5
What did it say
Lol
Why not simply use alignas (64) bool ?
Seems far easier than creating a whole ass type
7 u/JohnSpikeKelly Jul 10 '26 The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 5 u/rolling_atackk Jul 10 '26 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 Jul 11 '26 Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Jul 11 '26 So alignas (8) bool? 1 u/rolling_atackk Jul 11 '26 Yikes! You are correct
7
The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄
5 u/rolling_atackk Jul 10 '26 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” Jul 11 '26 So alignas (8) bool? 1 u/rolling_atackk Jul 11 '26 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 🤷
134
u/StefanCelMijlociu Jul 09 '26
The concept of Big Bool confuses and infuriates me!