Re: Reading a string of unknown size
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Mon, 27 Nov 2006 11:49:12 +0000
Santosh said:
Anyway, your allocation strategy is very inefficient. Your calling
realloc() once every iteration of the loop. This could result in
fragmentation of the C library's memory pool. Why not allocate in terms
of fixed sized or dynamically growing blocks, say 128 bytes or so to
start with?
Very True, I agree with you.
I just wanted to give "Tonio Cartonio" the idea of how to do it.
What you actually gave him was a very good demonstration of how not to do
it.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.
- Follow-Ups:
- Re: Reading a string of unknown size
- From: Spiros Bousbouras
- Re: Reading a string of unknown size
- References:
- Re: Reading a string of unknown size
- From: Santosh
- Re: Reading a string of unknown size
- From: santosh
- Re: Reading a string of unknown size
- From: Santosh
- Re: Reading a string of unknown size
- Prev by Date: Re: Reading a string of unknown size
- Next by Date: Re: empty parameterized macro
- Previous by thread: Re: Reading a string of unknown size
- Next by thread: Re: Reading a string of unknown size
- Index(es):
Relevant Pages
|
|