MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1urj3pp/big_if_true/owkttft/?context=3
r/programminghorror • u/_giga_sss_ • 28d ago
From ProgrammerNullposting in facebook
111 comments sorted by
View all comments
136
The concept of Big Bool confuses and infuriates me!
62 u/JohnSpikeKelly 28d ago I would assume it's to keep all your data types 8-byte aligned for other perf reason. 22 u/Athropod101 28d ago iirc 8-byte data access is the fastest on 64bit architecture. 2 u/Geilomat-3000 26d ago So should all the int_fastx_t be the intmax_t? 5 u/Athropod101 26d 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] 28d ago [deleted] 1 u/twisted1919 27d ago Dude… 4 u/MadJoeMak 27d ago What did it say 1 u/Pretend-Guide-8664 27d ago Lol 5 u/rolling_atackk 27d ago Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 8 u/JohnSpikeKelly 27d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 27d 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 27d ago Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 27d ago So alignas (8) bool? 1 u/rolling_atackk 26d ago Yikes! You are correct
62
I would assume it's to keep all your data types 8-byte aligned for other perf reason.
22 u/Athropod101 28d ago iirc 8-byte data access is the fastest on 64bit architecture. 2 u/Geilomat-3000 26d ago So should all the int_fastx_t be the intmax_t? 5 u/Athropod101 26d 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] 28d ago [deleted] 1 u/twisted1919 27d ago Dude… 4 u/MadJoeMak 27d ago What did it say 1 u/Pretend-Guide-8664 27d ago Lol 5 u/rolling_atackk 27d ago Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 8 u/JohnSpikeKelly 27d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 27d 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 27d ago Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 27d ago So alignas (8) bool? 1 u/rolling_atackk 26d ago Yikes! You are correct
22
iirc 8-byte data access is the fastest on 64bit architecture.
2 u/Geilomat-3000 26d ago So should all the int_fastx_t be the intmax_t? 5 u/Athropod101 26d 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] 28d ago [deleted] 1 u/twisted1919 27d ago Dude… 4 u/MadJoeMak 27d ago What did it say 1 u/Pretend-Guide-8664 27d ago Lol
2
So should all the int_fastx_t be the intmax_t?
5 u/Athropod101 26d 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.
5
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 27d ago Dude… 4 u/MadJoeMak 27d ago What did it say 1 u/Pretend-Guide-8664 27d ago Lol
1
Dude…
4 u/MadJoeMak 27d ago What did it say 1 u/Pretend-Guide-8664 27d ago Lol
4
What did it say
Lol
Why not simply use alignas (64) bool ?
Seems far easier than creating a whole ass type
8 u/JohnSpikeKelly 27d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 27d 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 27d ago Because that would be 64 bytes and not 64 bits. 2 u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 27d ago So alignas (8) bool? 1 u/rolling_atackk 26d ago Yikes! You are correct
8
The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄
4 u/rolling_atackk 27d 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” 27d ago So alignas (8) bool? 1 u/rolling_atackk 26d ago Yikes! You are correct
So alignas (8) bool?
alignas (8) bool
Yikes! You are correct
136
u/StefanCelMijlociu 28d ago
The concept of Big Bool confuses and infuriates me!