What is the ideal usage of std::nothrow
?
Only very few programs should ever allocate more than 1 GiB of memory, and since modern systems overcommit memory, new
will never return null or throw on these systems. Therefore, there is absolutely no point in checking the return value of new/malloc at all. Just keep your memory footprint down and let the out-of-memory-killer shoot down other processes!