3 ms·
That blog post describes Linux's default 'memory overcommitment' behaviour. Oddly it fails to mention the term 'overcommit'. As the post says, malloc can retur
by MaxBarraclough 7y ago
That blog post describes Linux's default 'memory overcommitment' behaviour. Oddly it fails to mention the term 'overcommit'.
As the post says, malloc can return null even where overcommit is used; it's not true that malloc never fails when overcommit is enabled.
Even if it were true that malloc/calloc/realloc/new/new[] could never fail on your OS+compiler, it doesn't seem wise to write code that relies on that non-standard guarantee. Poor robustness and portability.