Article View: comp.lang.c
Article #1968Re: is wraper on realloc good idea? maybe more wrappers?
From: Ross Finlayson
Date: Sun, 29 Nov 2026 16:04
Date: Sun, 29 Nov 2026 16:04
123 lines
7909 bytes
7909 bytes
On 11/29/2026 07:43 AM, Ross Finlayson wrote:
> On 11/29/2026 06:57 AM, fir wrote:
>> fir pisze:
>>> never used it but generally wrappers on some standard functions
>>> probably are good idea, or not?
>>
>> i also think if not tu built in system for localizing runtime errors
>>
>> i rarely have runtime errors but when something appears its unplesant
>> the you need to do such weird debug thing to localize crash
>>
>> sulution would be doing some simple list where i would log some
>> function tags in array in ram then probably i could show this is
>> system/signal/crash handler i guess
>>
>> i will see and probably will check it when having runtime cras next time
>
>
> In a sort of "C-minus" approach for "global-calls" or "glo-calls" above
> "system-calls" or sys-calls", like I was just saying, there's an idea
> to _hide_ syscalls via glocalls, that since when above "bare metal"
> there's for example POSIX or the O.S. and processes & threads, where
> a certain amount of discipline can always begin a process with
> installing "glo-calls", then begin a thread with installing "glo-calls",
> then with thread-local-storage making function pointers,
> then that those are typed and for example live in a struct according
> to types so the compiler can infer their types, then basically
> that it adds a layer of functional indirection to each of those calls,
> which some may aver would be wrong, yet then would be modular and
> decomposable & recomposable, for composability, and modularity.
>
> Kind of like syscalls are issued numbers then made signatures their
> functional signatures, it's a similar idea for glocalls, except for
> the process & thread, instead of the overall "globals" or system itself.
>
>
>
> Then another thing fir scribbled the other day was unbalanced
> parentheses, was "A { B { } /* closes A */ } /* closes B */ "
> which is unbalanced when "A{ B{} }" is nested, about the state & scope
> and a sort of "rock & roll" approach when re-using buffers, this
> being about that in C: there's later the _defer_ keyword, which
> indicates "the execution-graph will result in the flow-graph that
> any of many possible exit-points visits the deferred statements
> in LIFO order", and the call-stack in LIFO and call-sites in FIFO,
> entry-sites and exit-sites or entry-points and exit-points, about
> basically the "computed return value" which is a compiler extension
> so that a function can know whether it's a first-descendent or
> sibling or where it's at the location, about entry-points, since
> there's no way to cover all the exit-points, without a lot of discipline
> and redundancy in code, or changing the calling conventions.
>
>
> I.e., the LIFO account of the call-stack and the linear contiguous
> process/thread address space makes for lots of opportunities to use
> arithmetic for the LIFO call-stack and FIFO call-sites, given that
> there's not "goto" and that callee-functions always return to the
> caller-function, about for example rocking & rolling re-used buffers
> down through a bunch of property accessors and formatters, vis-a-vis
> glo-calls about threads with small caches for re-used buffers,
> then making for "location" as considered a sort of first-class
> account for debugging, when basically that "locators" and "location",
> like "source locators" or ye olde "FILE, LINE, ..." macros,
> instead to just have locators according to the debug symbols so
> that functions can just have a static variable that according to
> the lifetime of the thread a thread-local variable for re-entrancy,
> is about location and LIFO call-stack and FIFO call-site in all the code.
>
>
>
Say for example that logging & metrics & tracing & debugging are
first-class concerns for any sort of program, they're cross-cutting
concerns like from "aspect-oriented programming", vis-a-vis ideas
like tear-offs and mixins and so on yet for AOP, here about
instrumentation, then for example leaving some NOPs in the code
so the debugger can always re-write its breakpoints into the code,
then particularly about the "locator", basically to make for that
there's only one tool the compiler (and its usual ecosystem of tools for
archive and link and libraries and the object file and sections what
result segments then for "debug symbols" or plainly "locator symbols"),
and it may generate or a build-step can generate what's
a reasonable section of the object file then that instead of ever
having FILE/LINE/FUNCTION macros sitting in the code, basically has
that the loader/linker can be made to do work and update the offsets
when the program starts, to install to what results a static in each
function its location, then for example about cross-cutting concerns
like logging & metrics & tracing & debugging, which often for example
should have _zero_ impact yet in the more verbose accounts become
increasingly instrumented/impactful, then is for an account of
making "location" a usual first-class cross-cutting account of
using the usual symbol files to result also program artifacts,
when for example it's to be transparent then for example that
the programming can be run with a sort of "otrace" or "ftrace"
output that sits inline with like "strace" or "ltrace", system
and library tracers, printing an entire result of the overall execution
graph.
Then accounts like logging & metrics basically for a "logmask and
metmask" can result that the locator results "logsite and metsite",
then for conditioning log-level and metrics-resolution at runtime,
with the usual idea of not even appearing to exist in the source
code except perhaps having a boilerplate line at the beginning of each
function of interest (others considered "inline").
Then, figuring out location/locator, for example making the
loader/linker do the work of "relocating the symbols",
may result those aspects behind an [un-likely] branch to
an indirect function pointer, type-safe and re-entrant as
it were, instead of "cluttering the code".
Idea being it would be the same and unobtrusive usually for
all programs, and yet work seamlessly and nicely with debuggers,
tracers, metrics-collectors, log-collectors, ..., as just another
common build-step, then with some minimum sorts conventions and
simplest sort of discipline, all without much inflating the code.
These are always usual "global" concerns.
Technical Details
Message-ID:
<Qpmcnacin7Zq0ZH2nZ2dnZfqn_udnZ2d@giganews.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mailReferences:
<11eh538$3fet7$1@dont-email.me> <11eheha$3j5qd$1@dont-email.me> <d4-dnToMi6Tf1ZH2nZ2dnZfqn_qdnZ2d@giganews.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!border-4.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 29 Nov 2026 16:04:07 +0000 Subject: Re: is wraper on realloc good idea? maybe more wrappers? Newsgroups: comp.lang.c References: <11eh538$3fet7$1@dont-email.me> <11eheha$3j5qd$1@dont-email.me> <d4-dnToMi6Tf1ZH2nZ2dnZfqn_qdnZ2d@giganews.com> From: Ross Finlayson <ross.a.finlayson@gmail.com> Date: Sun, 29 Nov 2026 08:04:00 -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: <d4-dnToMi6Tf1ZH2nZ2dnZfqn_qdnZ2d@giganews.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <Qpmcnacin7Zq0ZH2nZ2dnZfqn_udnZ2d@giganews.com> Lines: 123 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-CiXooY6KS510pLR3HWXw+fA2ohpsNsKw9debUbi+TUSVu+bIy8cGRMMrbMKufmNoB3q6seZRoNBzgD7!vaFNuq79wotp1CNCmeNKQmcNOPrYPq80Oqfpypl81pEpIqkiX7grE1Fhy7H57ab3ceK2/AZXjUc+ 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