Sujet : Re: realloc() - frequency, conditions, or experiences about relocation?
De : ben (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.lang.c sci.stat.mathDate : 19. Jun 2024, 16:36:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <875xu5t066.fsf@bsb.me.uk>
References : 1 2 3 4 5 6 7 8
User-Agent : Gnus/5.13 (Gnus v5.13)
Malcolm McLean <
malcolm.arthur.mclean@gmail.com> writes:
No. We have to have some knowledge. And what we probaby know is that the
input is a file stored on someone's personal computer. And someone has
published on the statistical distribution of such files
That's not the case that matters (to me at least). If the input is a
file, we have a much better way of "guessing" the size than guessing and
growing -- just ask for the size. Sure, we might need to make
adjustments if the file is changing, but there is always a better
measure than any statistical analysis.
To some extent this seems like a solution in search of a problem.
Growing the buffer exponentially is simple and effective.
-- Ben.
Date | Sujet | # | | Auteur |
17 Jun 24 | Re: realloc() - frequency, conditions, or experiences about relocation? | 22 | | Anton Shepelev |
18 Jun 24 |  Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | David Jones |
19 Jun 24 |  Re: realloc() - frequency, conditions, or experiences about relocation? | 8 | | David Duffy |
19 Jun 24 |   Re: realloc() - frequency, conditions, or experiences about relocation? | 6 | | Malcolm McLean |
19 Jun 24 |    Re: realloc() - frequency, conditions, or experiences about relocation? | 3 | | Ben Bacarisse |
19 Jun 24 |     Re: realloc() - frequency, conditions, or experiences about relocation? | 2 | | David Brown |
19 Jun 24 |      Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | Ben Bacarisse |
19 Jun 24 |    Re: realloc() - frequency, conditions, or experiences about relocation? | 2 | | Anton Shepelev |
8 Jul 24 |     Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | Anton Shepelev |
19 Jun 24 |   Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | Anton Shepelev |
2 Jul 24 |  Re: realloc() - frequency, conditions, or experiences about relocation? | 12 | | Rich Ulrich |
2 Jul 24 |   Re: realloc() - frequency, conditions, or experiences about relocation? | 5 | | Keith Thompson |
2 Jul 24 |    Re: realloc() - frequency, conditions, or experiences about relocation? | 4 | | Rich Ulrich |
8 Jul 24 |     Re: realloc() - frequency, conditions, or experiences about relocation? | 3 | | Anton Shepelev |
22 Jul 24 |      Re: realloc() - frequency, conditions, or experiences about relocation? | 2 | | Rich Ulrich |
23 Jul 24 |       Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | Anton Shepelev |
2 Jul 24 |   Re: realloc() - frequency, conditions, or experiences about relocation? | 6 | | Paul |
2 Jul 24 |    Re: realloc() - frequency, conditions, or experiences about relocation? | 5 | | Rich Ulrich |
2 Jul 24 |     Re: realloc() - frequency, conditions, or experiences about relocation? | 4 | | Rich Ulrich |
2 Jul 24 |      Re: realloc() - frequency, conditions, or experiences about relocation? | 3 | | Paul |
2 Jul 24 |       Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | James Kuyper |
2 Jul 24 |       Re: realloc() - frequency, conditions, or experiences about relocation? | 1 | | James Kuyper |