Regarding uint8_t in node header definition
Hello, I'm still a learner of the c programming language and database. The below line has uint8_t but the definitions above it are all uint32_t, I think they should use the same def, all uint8_t or all uint32_t, is there any detail here I didn't notice?
https://github.com/cstack/db_tutorial/blob/051b5c0b142650d357e89757318f88051e3d41b0/db.c#L96
It's a matter of opinion in code and some people want to use the smallest datatype necessary. Possibly because it conveys some information to the reader that a header size won't be more than 255, whatever the number is.
This is more common in larger data structures. Say you have an absolute binary offset: you'll probably store it as a uint_64 to be safe (able to store offsets into several GBs) - meanwhile a magic header (like PNG) will be uint_8 since it's only a few bytes.