kernel32 is an official API, you're probably thinking of ntdll. CRT is the C-runtime. Not everything is written in C.
38 karma · joined June 21, 2024
In my experience this was a problem over 25 years ago when I developed for Solaris and other non-Linux operating systems.
Using Vec for arrays is also annoying, repeating the mistake from C++.
Basically, the overhead of exceptions is probably less than handling the same errors manually in any non-trivial program.
Also, it's not like these table doesn't exist in other languages. Both Rust and Go have to unwind.
I haven't tried the OSSC Pro, but the Retrotink 4k should probably also work fine and is really easy to use. A bit on the expensive side though...
#include <cstdint>
uint32_t read_le_uint32(const uint8_t* p)
{
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}
ends up as read_le_uint32(unsigned char const*):
mov eax, dword ptr [rdi]
ret
This works with Clang and gcc on x86_64 (but not with MSVC).It manages 1.1 GH/s on an Intel i7-13700K.