Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix integer overflow in memory calculations on 32bit systems
"long int" on at least x86 Linux is exactly the same as a plain "int", so calculations can easily overflow. 32bit systems are not expected to have hundreds of gigabytes of memory but a 32bit process on a x86_64 can run into all sorts of funny things, such having 500GB system memory. At which point the type capable of addressing all of process memory is absolutely useless for calculating the total memory. Use uint64_t in the memory calculations to make the size explicit. Of course one day we may cross that border too, but I hope to be retired by then. Fixes https://issues.redhat.com/browse/RHEL-16557
- Loading branch information