🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #1969

Re: is wraper on realloc good idea? maybe more wrappers?

#1969
From: Andrey Tarasevich
Date: Sun, 29 Nov 2026 16:09
17 lines
1976 bytes
On Sun 11/29/2026 4:16 AM, fir wrote:
> never used it but generally wrappers on some standard functions
> probably are good idea, or not?

In programs that perform non-interactive batch-style processing (e.g. 
config file on input, result file on output), error handling is usually 
a very simple affair: just complain and abort, no need for any kind of 
post-error recovery in most cases. In such programs wrappers around 
malloc/calloc/realloc work very well. The wrapper checks for success and 
simply aborts the entire program with an error message in case of 
failure. This allows client code to completely forget about having to 
worry about this sort of errors. I.e. it uses the wrapper under 
assumption that the wrapper "always succeeds".

-- 
Best regards,
Andrey
Technical Details
Message-ID: <11ehine$3kr02$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-mail
References: <11eh538$3fet7$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: Andrey Tarasevich <noone@noone.net>
Newsgroups: comp.lang.c
Subject: Re: is wraper on realloc good idea? maybe more wrappers?
Date: Sun, 29 Nov 2026 08:09:16 -0800
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <11ehine$3kr02$1@dont-email.me>
References: <11eh538$3fet7$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 Nov 2026 16:09:19 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3828738"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18uSeQeug6w/G6eTgP2l3A1"; posting-host="309647c57fcb872f539d1ec49f53dc35"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:y79rW9D3nuihWmSjYRo9vK4fsU8= sha256:YLq752uPY/qVmSE589puoVvBCda7qrJP/jdS1k+GlVM=
	sha1:T4OB4Dg58Eau+93qrfF6xvcG4zM= sha256:2rU7XTEBmQKf4CBJ0Q+Efxm2OtOy/DPDaJlBbTGAjoc=
In-Reply-To: <11eh538$3fet7$1@dont-email.me>
Content-Language: en-US