git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Completion of error handling

From
Avery Pennarun <apenwarr@gmail.com>
Date
Feb 2, 2010, 19:49 UTC
Message-ID
<32541b131002021149g6ffe703erd9e25621e4305a52@mail.gmail.com>
In-Reply-To
<4B688042.8090400@web.de>
On Tue, Feb 2, 2010 at 2:42 PM, Markus Elfring <Markus.Elfring@web.de> wrote:
Show 5 quoted lines
> Nicolas wrote:
>> At least on Linux, most of those functions simply cannot fail.
>
> Would you like to support software environments that work without a
> famous out-of-memory killer?

In many cases on Linux systems, you don't get the OOM notification anyway until you try to *use* the memory, not at allocation time. So even checking the results of malloc() won't always save you (although *not* checking can make problems even worse).

However, for functions that can't allocate memory at all, it's extra pointless to worry about.

>> There is just no dynamic memory allocation involved.
>
> I find this opinion strange.

This isn't an opinion; because it's open source, you can actually look at the source code and find out that many system calls don't do memory allocation at all.

Avery
Previous: Markus ElfringNext: Markus Elfring
Message 6 of 14 in “Completion of error handling”
  1. Markus ElfringFeb 2, 2010
  2. Nicolas PitreFeb 2, 2010
  3. Markus ElfringFeb 2, 2010
  4. Nicolas PitreFeb 2, 2010
  5. Markus ElfringFeb 2, 2010
  6. Avery PennarunFeb 2, 2010
  7. Markus ElfringFeb 2, 2010
  8. Avery PennarunFeb 2, 2010
  9. Markus ElfringFeb 2, 2010
  10. Avery PennarunFeb 2, 2010
  11. Markus ElfringFeb 2, 2010
  12. Markus ElfringFeb 11, 2010
  13. Andreas EricssonFeb 16, 2010
  14. Markus ElfringFeb 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.