🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #2018

Re: is a wrapper on memory-allocation calls a good idea?

#2018
From: fir
Date: Mon, 30 Nov 2026 13:48
43 lines
3289 bytes
fir pisze:
> 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

maybe it was not even few thousends it was more like after 80x3000 
reallocks ;c

>- 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: <11ejurd$fgms$2@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-mail
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> <11ejuo5$fgms$1@dont-email.me>

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:48:29 +0100
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <11ejurd$fgms$2@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> <11ejuo5$fgms$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 30 Nov 2026 13:48:29 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="508636"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19fpcJc0j8ZivYOzPqlR29K6U0cgkGi3TE="; 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:a5wSSE90OUOi7xM3aWPtTudxBwk= sha256:72edFokKSzpkIqGKYcmdPynUAB/COTZ7g3jYiTcUDBE=
	sha1:lSScI6hLMY+qwLEgQ2WEFe7UohM= sha256:FmcMHgXG5BgADf9oUJJUOyG5okQqTy74YSrSEro+XIE=
In-Reply-To: <11ejuo5$fgms$1@dont-email.me>