Re: xmalloc string functions



Yevgen Muntyan <muntyan@xxxxxxxxxxxxxxxxxxx> writes:

Kelsey Bjarnason wrote:
On Sun, 27 Jan 2008 20:34:58 +0000, Yevgen Muntyan wrote:

Malcolm McLean wrote:
Here are six functions implemented on top of xmalloc(). No C programmer
should have any triouble providing the implemetations, though replace
and getquote are non-trivial.
[snip]

I've think we've got something quite powerful here, purely because none
of these functions can ever return null for out of memory conditions.
It massively simplifies string handling.
Take a look at glib,
http://library.gnome.org/devel/glib/2.14/glib-Memory-Allocation.html

Oh, good God. They didn't. Tell me they didn't.

One wonders how many applications they've screwed over with that bit
of asinine idiocy.

One wonders why one wonders about that only after he learns about
g_malloc. Perhaps because those applications aren't actually screwed?

Precisely, but welcome to c.l.c
.



Relevant Pages

  • Re: xmalloc string functions
    ... should have any triouble providing the implemetations, though replace and getquote are non-trivial. ... of these functions can ever return null for out of memory conditions. ...
    (comp.lang.c)
  • Re: xmalloc string functions
    ... Yevgen Muntyan wrote: ... should have any triouble providing the implemetations, ... and getquote are non-trivial. ...
    (comp.lang.c)
  • Re: xmalloc string functions
    ... should have any triouble providing the implemetations, though replace and getquote are non-trivial. ... of these functions can ever return null for out of memory conditions. ...
    (comp.lang.c)
  • Re: xmalloc string functions
    ... should have any triouble providing the implemetations, ... and getquote are non-trivial. ... of these functions can ever return null for out of memory conditions. ... One wonders how many applications they've screwed over with that bit of asinine idiocy. ...
    (comp.lang.c)
  • Re: xmalloc string functions
    ... though replace and getquote are non-trivial. ... none of these functions can ever return null for out of memory ... Perhaps because those applications aren't actually screwed? ... What's their recovery mechanism on allocation failure, ...
    (comp.lang.c)