3 ms·
If you took this rule literally though, you’d have to support bigints everywhere. Yet, in practice, setting the limit as INT64_MAX is seen as sufficient to coun
by skissane 4y ago
If you took this rule literally though, you’d have to support bigints everywhere. Yet, in practice, setting the limit as INT64_MAX is seen as sufficient to count as “infinity”.
In computing, “infinite” is almost never meant literally. When people say “infinite”, they really mean “finite but really really big”
- iudqnolq 4y agoInfinity here means "so big you don't have to think about reaching out". For example, the Rust standard library assumes no system could possibly support more usize::MAX/2 threads, but it worries about you cloning an atomically reference counted pointer usize::MAX times.
- xigoi 4y agoYou'll run out of memory long before your array can reach 2^64 items.
- skissane 4y agoWhich means in a practice “infinity” is a lot lower than 2^64, although exactly how much lower depends on system configuration (how much memory the system has, how much of it this process is permitted to consume)
- xigoi 4y agoThe point is that the limit should be determined by physical limitations of the hardware, not an arbitrary number chosen by the programmer.
- skissane 4y ago> The point is that the limit should be determined by physical limitations of the hardware, not an arbitrary number chosen by the programmer. A machine might have 64GB of RAM, but this application might be configured to be allowed to consume a maximum of 4GB of it. In which case, the limit isn’t being determined by the physical limitations of the hardware; whether or not it is under the control of the programmer depends on who does what. Some programmers get to decide how much memory to allocate to their program, for others that decision is made by somebody else.