Article View: comp.lang.c
Article #2016Re: is a wrapper on memory-allocation calls a good idea?
From: Dan Cross
Date: Mon, 30 Nov 2026 12:36
Date: Mon, 30 Nov 2026 12:36
25 lines
2023 bytes
2023 bytes
In article <11ej60c$6bhr$1@dont-email.me>, Andrey Tarasevich <noone@noone.net> wrote: >On Sun 11/29/2026 10:00 PM, Lawrence D’Oliveiro wrote: >> So you don’t even need to bother to check for memory-allocation >> failures, because you will never get a failure status. > >Well, firstly, overcommit approach simply substitutes "virtual address >space" in place of "actual memory" as the limited resource. And while >address space is usually huge, one can still exhaust it if one really >sets their mind to it. This can still lead to an allocation failure. >[snip] And even if we consider virtual memory near-infinite for practical purposes, systems usually still impose an artifical cap on it in the form of a configurable resource limit; this is usually well-below the size of the virtual address space. I am reminded of some of the programming advice common in the after the introduction of virtual memory in Unix with the adoption of the 32-bit VAX: "We've got a whole 4 Gigs! No one will ever use all of that, but you should still check the return value of `malloc`." - Dan C.
Technical Details
Message-ID:
<11ejqjj$ppq$1@reader2.panix.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ej3eh$5ajn$3@dont-email.me> <11ej60c$6bhr$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail From: cross@spitfire.i.gajendra.net (Dan Cross) Newsgroups: comp.lang.c Subject: Re: is a wrapper on memory-allocation calls a good idea? Date: Mon, 30 Nov 2026 12:36:03 -0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Message-ID: <11ejqjj$ppq$1@reader2.panix.com> References: <11eh538$3fet7$1@dont-email.me> <11ehine$3kr02$1@dont-email.me> <11ej3eh$5ajn$3@dont-email.me> <11ej60c$6bhr$1@dont-email.me> Injection-Date: Mon, 30 Nov 2026 12:36:03 -0000 (UTC) Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80"; logging-data="26426"; mail-complaints-to="abuse@panix.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: cross@spitfire.i.gajendra.net (Dan Cross)