From a03f33f09fd8f73baa73189e4b73e85e7fef05ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Sun, 11 Aug 2019 00:00:04 +0000 Subject: [PATCH] malloc max: explain how they fail --- README.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.adoc b/README.adoc index d4f8a34..da61cca 100644 --- a/README.adoc +++ b/README.adoc @@ -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