malloc max: explain how they fail

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-08-11 00:00:04 +00:00
parent 915b04a76e
commit a03f33f09f

View File

@@ -12569,6 +12569,8 @@ which is `4Gib * sizeof(int) == 16GiB`, but these fail at 32GiB:
./userland/linux/mmap_anonymous.out 0x200000000
....
`malloc` returns NULL, and `mmap` goes a bit further and segfauls on the first assignment `array[0] = 1`.
Bibliography: https://stackoverflow.com/questions/2798330/maximum-memory-which-malloc-can-allocate
==== GCC C extensions