Hario no kai (はりおの階)

C: Trick or Treat?

Posted by: hario on: December 28, 2007

One of the things that amazes me about the C programming language is that you can always
find something new: it teaches you to be humble about your programming wizardry. Today I have found two new mind-melting techiques which can cause serious brain damage:

  • Duff’s Device: speeding-up tight loops by unrolling and using a switch statement in order to create a jump table for the leftover iterations of the unrolled loop. Cheesy.
  • Coroutines implemented in plain standard ANSI C. Contains heavy preprocessor abuse and some constructions derived from Duff’s Device.I definetely loved this one!

This was my christmas present for my readers, hope you found this enlightening ;-)

Tags: , ,

Leave a Reply

¡Camarero! ¡Una de arroz con té!
Ingenieros de Zanussi desde 1983.

Archives

Bookmarks