Re: Removing bound checks from a switch statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I do not know how to solve the problem you described, but another way of
speeding up a switch statement might be using the GCC extension "Labels
as Values".

http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html

You can retain compatibility to standard C by writing two versions of
the code, one which uses GCC extension and which does not.

Your reaction_t would be an enum for standard C and a void * for gcc.

I am using this trick for my python-like Generator class with iterator
interface (http://vc.falma.de/cfc/tree/cfc/generator.hh)

Would this help?

Christoph


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux