mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 04:01:36 +01:00
malloc max: explain how they fail
This commit is contained in:
@@ -12569,6 +12569,8 @@ which is `4Gib * sizeof(int) == 16GiB`, but these fail at 32GiB:
|
|||||||
./userland/linux/mmap_anonymous.out 0x200000000
|
./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
|
Bibliography: https://stackoverflow.com/questions/2798330/maximum-memory-which-malloc-can-allocate
|
||||||
|
|
||||||
==== GCC C extensions
|
==== GCC C extensions
|
||||||
|
|||||||
Reference in New Issue
Block a user