I am working on a Linux counter which should count all installed Linux machines (all linux kernel based, that is including Android and so on) to date (and in the future). Here’s what I’ve got:
#include <stdint.h>
int main(int argc, char ** argv)
{
uint32_t num_linux_machines = count_current_linux_machines();
while (1) {
wait_for_next_linux_machine_installed();
num_linux_machines++;
}
}
Don’t worry about the count() and wait() functions, I’ll do that later. The question is: Do you think that uint32_t will be sufficient for the next, say 5 years or should I use uint64_t right away instead? Thanks for any insights 😉
The real question that would be harder to answer is how to implement the two missing functions (that is which heuristics to use).
A 64-bit counter only consumes 4 additional bytes, so why not? It’s not like 4 more bytes will bloat the program.