Begone, vile creature, use call/cc if you’re into that kind of stuff. What you’re doing might be consensual but it sure ain’t safe or sane. Unless you’re implementingcall/cc, then I forgive you, and extend my condolences.
A more serious answer would be that Rust can’t be compiled to all targets. There is a lot of work to get Rust to compile with gcc though, which would help with this tremendously.
That’s a performance optimisation which llvm is likely to do for you anyways, jump tables aren’t exactly rocket science. Gazing into my crystal ball, might have to turn your enum variant Foo(u8) with possible values 0…15 into Foo0 through Foo15 (or maybe better Foo(EnumWith16Variants)) so that the compiler doesn’t have to evaluate code to figure out that it doesn’t need to NOP the rest of the jump range out, or bail out of generating a jump table, whatever it would do.
deleted by creator
Longjmp? Not that the kernel uses that ofc.
Begone, vile creature, use
call/ccif you’re into that kind of stuff. What you’re doing might be consensual but it sure ain’t safe or sane. Unless you’re implementingcall/cc, then I forgive you, and extend my condolences.A more serious answer would be that Rust can’t be compiled to all targets. There is a lot of work to get Rust to compile with gcc though, which would help with this tremendously.
Gnu C has computed goto.
That’s a performance optimisation which llvm is likely to do for you anyways, jump tables aren’t exactly rocket science. Gazing into my crystal ball, might have to turn your enum variant
Foo(u8)with possible values 0…15 intoFoo0throughFoo15(or maybe betterFoo(EnumWith16Variants)) so that the compiler doesn’t have to evaluate code to figure out that it doesn’t need to NOP the rest of the jump range out, or bail out of generating a jump table, whatever it would do.