Re: xmalloc string functions



Yevgen Muntyan <muntyan@xxxxxxxxxxxxxxxxxxx> 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

glib is where bad ideas go to die. Now, if somebody just had the nerve to
tell them....

.



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
    ... 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. ... One wonders how many applications they've screwed over with that bit ...
    (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. ... massively simplifies string handling. ...
    (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. ...
    (comp.lang.c)