Re: Variable-sized lines of text in linked list



CBFalconer said:

<snip>

However you carefully snipped the portion where I pointed out that
this is no different than using the malloc family in any program.

I carefully snipped out the portion where you mentioned malloc because I
didn't see how it was relevant to what I was saying. I *always* remove (or
at least I always try to remember to remove) text from my reply if it is
irrelevant to the point I am making about the article to which it relates.

It is certainly true that, every time you call malloc, you are responsible
for freeing the memory thus allocated. It is for *precisely* this reason
that it's a good idea to reduce the number of calls to malloc to the bare
minimum. The ggets function fails to do this.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: Local Heap?
    ... CBFalconer wrote: ... >>C portion of it first. ... can a value returned by malloc() not be used in a subsequent ...
    (comp.lang.c)
  • Re: Pointer to small amount of storage
    ... CBFalconer wrote, On 24/02/08 00:56: ... snip ... ... That malloc doesn't assign enough space to hold the posited long. ... Flash Gordon ...
    (comp.lang.c)
  • Re: why 50% of allocated memory is not freed?
    ... CBFalconer writes: ... snip ... ... An int * points to the first of many ints. ... better way to call malloc that avoids this problem: ...
    (comp.lang.c)
  • Re: Variable-sized lines of text in linked list
    ... I carefully snipped out the portion where you mentioned malloc because I ... The ggets function fails to do this. ... The ggets documentation specifically states that memory is ...
    (comp.lang.c)
  • Re: malloc/free question
    ... I'd like to be able to malloc a block of memory, ... certain portion of it. ... For example, malloc 100 ... previous call to malloc, calloc, or reallocor a null pointer ...
    (comp.lang.c)