4 ms·
One fascinating example in C programming is "Duff's device." This clever technique unrolls a loop to copy data from one location to another with remarkable effi
by tonyabracadabra 2y ago
One fascinating example in C programming is "Duff's device." This clever technique unrolls a loop to copy data from one location to another with remarkable efficiency. It's notorious among C programmers for its unusual and complex structure, often leaving them astonished that it not only compiles but also conforms to the C language standards.
And what’s weirder? You can now enjoy it in music!
- sargstuff 2y agocould also modify duffs device to employ on the fly 'endian'ness[1] modifications. 4 songs out of one (at least on 32bit and 'commonly used endian' schemes). [1] : https://en.wikipedia.org/wiki/Endianness https://en.wikipedia.org/wiki/Endianness
- tonyabracadabra 2y agohaha so oddly fun : P