Article View: comp.lang.c
Article #2017Re: is a wrapper on memory-allocation calls a good idea?
From: fir
Date: Mon, 30 Nov 2026 13:46
Date: Mon, 30 Nov 2026 13:46
36 lines
3106 bytes
3106 bytes
Dan Cross pisze: > 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. > yesterday i got a crash related to reallock.. first time in my life probbaly..it happend i wrote 1 slot after a reallocked memory and it heppen 'sometimes' though rarely this 1 slot did overvritte some of its metadata so sometimes - liek really rare something like few thousand reallocks - i got a crash on reallock..thoug everything besides was ok.. so it took me over hour to find it... i really rare dil with crashes (as i rarely use pointers though in 'modern c' i would say (as i myself define it) i m a real heavu user of realloc
Technical Details
Message-ID:
<11ejuo5$fgms$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!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> <11ejqjj$ppq$1@reader2.panix.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: fir <profesor.fir@gmail.com> Newsgroups: comp.lang.c Subject: Re: is a wrapper on memory-allocation calls a good idea? Date: Mon, 30 Nov 2026 14:46:45 +0100 Organization: A noiseless patient Spider Lines: 36 Message-ID: <11ejuo5$fgms$1@dont-email.me> 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> <11ejqjj$ppq$1@reader2.panix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 30 Nov 2026 13:46:46 +0000 (UTC) Injection-Info: dont-email.me; logging-data="508636"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18lFzRoyfu8hdolbuxMauha4I5Xh0AxqvY="; posting-host="2edf17490e4dad8cc45cff77aa4a7fc7" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0 SeaMonkey/2.53.24 Cancel-Lock: sha1:DslvgrB5VU0FCnF8b5NzF0zpZxU= sha256:KSthrbVyDMobJPwvzE1xZ4D0W6+laD82IfB+wJZZriU= sha1:7CTv+SpC+QGIR3YiewOxneHboCM= sha256:qRus2e6zMCfRRUTiUOGPHypbn49c9d2a2RI7Dcy+phk= In-Reply-To: <11ejqjj$ppq$1@reader2.panix.com>