Article View: comp.lang.c
Article #1324Re: C: a question about scope automatics in C
From: Keith Thompson
Date: Wed, 04 Nov 2026 18:45
Date: Wed, 04 Nov 2026 18:45
29 lines
2525 bytes
2525 bytes
Ross Finlayson <ross.a.finlayson@gmail.com> writes:
[...]
> So, malloc and free are system-calls, in the implementation
> or the runtime or the O.S., and so when the structure is
> already in the code or data-segment, and needn't be
> re-entrant, then these system-calls can be reduced.
The term "system call" (it's not hyphenated) has a specific meaning.
On Linux-based systems, and many others, a system call is an entry
point into the kernel. It's not a C concept.
malloc and free are functions that are part of the C standard library.
They are *not* typically implemented as system calls. Typically
malloc() can operate in the context of the calling program, interacting
with the kernel only when necessary. free() typically does the same,
but doesn't return memory to the OS, so I wouldn't expect free() to
result in any system calls.
Some C library functions might be implemented as system calls (time(),
for example) -- but that shouldn't matter most of the time.
(There's also a library called named "system", which can cause some
confusion; a call to system() is not a "system call".)
[...]
--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */
Technical Details
Message-ID:
<11cfuh4$ug8i$1@kst.eternal-september.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mailReferences:
<oOScndMmgZhYRXX3nZ2dnZfqnPGdnZ2d@giganews.com> <11cce4h$3m11i$1@dont-email.me> <8V2dnW6M3YIeZ3T3nZ2dnZfqn_SdnZ2d@giganews.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!kst.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson <Keith.S.Thompson+u@gmail.com> Newsgroups: comp.lang.c Subject: Re: C: a question about scope automatics in C Date: Wed, 04 Nov 2026 10:45:55 -0800 Organization: None to speak of Lines: 29 Message-ID: <11cfuh4$ug8i$1@kst.eternal-september.org> References: <oOScndMmgZhYRXX3nZ2dnZfqnPGdnZ2d@giganews.com> <11cce4h$3m11i$1@dont-email.me> <8V2dnW6M3YIeZ3T3nZ2dnZfqn_SdnZ2d@giganews.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Wed, 04 Nov 2026 18:45:56 +0000 (UTC) Injection-Info: kst.eternal-september.org; logging-data="999698"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+otf3EULkVw42WvkwA3MbW"; posting-host="0b7e1164bbf29f437faf490262eb400f" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:CZYBvgBs0LE28TQgzFkFuNamAxE= sha256:LrcGsvYY4UgrJiXswLjUgGSK516SJ9JSkr6Hrnr/kWA= sha1:AyZBSjZF7Ru709Q7BePYdRUsspY= sha256:xeTPL1qOWPXK5SMOQb3Ybum/F+S0TW0zGPYdSpDOw/U=