Article View: comp.lang.c
Article #2249Re: is wraper on realloc good idea? maybe more wrappers?
From: Ross Finlayson
Date: Sat, 05 Dec 2026 12:59
Date: Sat, 05 Dec 2026 12:59
41 lines
3347 bytes
3347 bytes
On 12/05/2026 04:38 AM, Ross Finlayson wrote: > On 12/05/2026 12:10 AM, Tristan Wibberley wrote: >> On 29/11/2026 12:16, fir wrote: >>> never used it but generally wrappers on some standard functions >>> probably are good idea, or not? >> >> The art of programming is all about wrapping, wrapping all the way down. >> >> The compsci way is to write a solution in the language of the problem >> domain then interpret that language in a language of the domain of >> interpreting that (class of) languages, and so forth until you get to >> your preferred system programming language. That's all wrapping and it's >> equivalent to looping and recursion without wrapping, just an >> alternative expression. >> >> But it's mostly a waste of time to wrap for the sake of wrapping - >> unless you're adding some type annotations/(pre/post)conditions/asserts, >> etc. Sometimes you can use the linker for that stuff instead of C. >> >> I don't know where to place EDSLs there. >> >> In C++ I sometimes wrap heap-stuff with smart-references because >> managing heap allocations is too hard, like chess - the rules are easy >> but it's not so easy to play a game; that's /almost/ an EDSL: couching >> allocation in terms of lexical scopes. >> > > Often usual accounts of low-level programming in C/C++ like C++ 98/03 > have that reference-counting smart-pointers hand-written in a page or > two are entirely common and completely ubiquitous for heap objects. > > In many C/C++ projects of that time, the only reason to use C++ at all was reference-counting smart-pointers for heap-objects, that for the account of "defer" in C making for grouping together in statement the effects of block & function scoping their exit, one of the very most usual sorts of things would be reference-counting smart-pointers.
Technical Details
Message-ID:
<WtednTb8ptlWl4n2nZ2dnZfqnPYk4z6o@giganews.com>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11f0gtg$2i7jn$3@dont-email.me> <YtKcnd7kZMAsmIn2nZ2dnZfqnPadnZ2d@giganews.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 05 Dec 2026 12:59:54 +0000 Subject: Re: is wraper on realloc good idea? maybe more wrappers? Newsgroups: comp.lang.c References: <11eh538$3fet7$1@dont-email.me> <11f0gtg$2i7jn$3@dont-email.me> <YtKcnd7kZMAsmIn2nZ2dnZfqnPadnZ2d@giganews.com> From: Ross Finlayson <ross.a.finlayson@gmail.com> Date: Sat, 5 Dec 2026 04:59:51 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <YtKcnd7kZMAsmIn2nZ2dnZfqnPadnZ2d@giganews.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <WtednTb8ptlWl4n2nZ2dnZfqnPYk4z6o@giganews.com> Lines: 41 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-pTk9NeXzFHCb/SWF0Wvu0F87A9BJquO5iIkwvdZ5nIZgVhBu24XCp17Xe6CUta5qUv8E7D3ZmxF4+fC!jPjEOd1ethvWY65Jm1qDquDt4GI4c75BnCUCqZOPWsvhyDgKbpUPt9oagx5ZB9r/e2SrVJnRCVFq!OQ== X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40