Re: realloc() - frequency, conditions, or experiences about relocation?

Liste des GroupesRevenir à cl c 
Sujet : Re: realloc() - frequency, conditions, or experiences about relocation?
De : malcolm.arthur.mclean (at) *nospam* gmail.com (Malcolm McLean)
Groupes : comp.lang.c
Date : 18. Jun 2024, 12:46:36
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4roic$1ad0g$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla Thunderbird
On 18/06/2024 11:19, Malcolm McLean wrote:
On 18/06/2024 08:09, Tim Rentsch wrote:
Anton Shepelev <anton.txt@g{oogle}mail.com> writes:
>
Ben Bacarisse to Malcolm McLean:
>
[next is a comment from Malcolm]
>
Your strategy for avoiding these extremes is exponential
growth.
>
It's odd to call it mine.  It's very widely know and used.
"The one I mentioned" might be less confusing description.
>
I think it is a modern English idiom, which I dislike as
well.  StackOverflow is full of questions starting like:
"How do you do this?" and "How do I do that?"  They are
informal ways of the more literary "How does one do this?"
or "What is the way to do that?"
>
I have a different take here.  First the "your" of "your
strategy" reads as a definite pronoun, meaning it refers
specifically to Ben and not to some unknown other party.
(And incidentally is subtly insulting because of that,
whether it was meant that way or not.)
>
Second the use of "you" to mean an unspecified other person
is not idiom but standard usage.  The word "you" is both a
definite pronoun and an indefinite pronoun, depending on
context.  The word "they" also has this property.  Consider
these two examples:
>
    The bank downtown was robbed.  They haven't been caught
    yet.
>
    They say the sheriff isn't going to run for re-election.
>
In the first example "they" is a definite pronoun, referring
to the people who robbed the bank.  In the second example,
"they" is an indefinite pronoun, referring to unspecified
people in general (perhaps but not necessarily everyone).
The word "you" is similar:  it can mean specifically the
listener, or it can mean generically anyone in a broader
audience, even those who never hear or read the statement
with "you" in it.
>
The word "one" used as a pronoun is more formal, and to me
at least often sounds stilted.  In US English "one" is most
often an indefinite pronoun, either second person or third
person.  But "one" can also be used as a first person
definite pronoun (referring to the speaker), which an online
reference tells me is chiefly British English.  (I would
guess that this usage predominates in "the Queen's English"
dialect of English, but I have very little experience in
such things.)
>
Finally I would normally read "I" as a first person definite
pronoun, and not an indefinite pronoun.  So I don't have any
problem with someone saying "how should I ..." when asking
for advice.  They aren't asking how someone else should ...
but how they should ..., and what advice I might give could
very well depend on who is doing the asking.
 Ben said
 > Restore snipped Ben upthread
"In practice, the cost is usually
moderate and can be very effectively managed by using an exponential
allocation scheme: at every reallocation multiply the storage space by
some factor greater than 1 (I often use 3/2, but doubling is often used
as well)."
 So it's open and shut, and no two ways about it. Ben's strategy is exponential growth. And to be fair I use that strategy myself in functions like fslutp(). It's only not Ben's strategy if we mean to imply that Ben was the first person to use expoential growth, or the first to understand the mathematical implications, and of course that's not the case. It was all worked out by Euler long before any of us were born.
 The question is whether we can be a bit more rigorous than "we need exonential growth, let's double on each reallocation. Actually, that looks a bit greedy. Try 3/2". And we can do that. We can put it on a sounder statistical footing. Whether it actually worth it or not is a different matter.
 
Here are some real stats on file sizes, in case anone is interested.
Data set, / OS Log-normal median & mean, Arithmetic mean, 50% occupied by
(< mean)
whole data set,   9.0 KB,   730 KB, 1.5 MB < 5.4 KB
Mac OS            8.0 KB,   533 KB, 1.4 MB < 4.9 KB
Windows           11.5 KB,  1.0 MB, 1.7 MB < 8.3 KB
GNU/Linux         10.8 KB,  1.7MB,  2.2 MB < 4.8 KB
https://www.researchgate.net/publication/353066615_How_Big_Are_Peoples%27_Computer_Files_File_Size_Distributions_Among_User-managed_Collections
--
Check out my hobby project.
http://malcolmmclean.github.io/babyxrc

Date Sujet#  Auteur
17 Jun 24 * realloc() - frequency, conditions, or experiences about relocation?95Janis Papanagnou
17 Jun 24 +- Re: realloc() - frequency, conditions, or experiences about relocation?1Chris M. Thomasson
17 Jun 24 +* Re: realloc() - frequency, conditions, or experiences about relocation?53Ben Bacarisse
17 Jun 24 i`* Re: realloc() - frequency, conditions, or experiences about relocation?52Malcolm McLean
17 Jun 24 i +* Re: realloc() - frequency, conditions, or experiences about relocation?50Ben Bacarisse
17 Jun 24 i i`* Re: realloc() - frequency, conditions, or experiences about relocation?49Malcolm McLean
17 Jun 24 i i +* Re: realloc() - frequency, conditions, or experiences about relocation?21Ben Bacarisse
17 Jun 24 i i i+* Re: realloc() - frequency, conditions, or experiences about relocation?17Anton Shepelev
18 Jun 24 i i ii`* Re: realloc() - frequency, conditions, or experiences about relocation?16Tim Rentsch
18 Jun 24 i i ii +* Re: realloc() - frequency, conditions, or experiences about relocation?8Malcolm McLean
18 Jun 24 i i ii i+* Re: realloc() - frequency, conditions, or experiences about relocation?5Malcolm McLean
29 Jun 24 i i ii ii`* Re: realloc() - frequency, conditions, or experiences about relocation?4Lawrence D'Oliveiro
2 Jul 24 i i ii ii `* Re: realloc() - frequency, conditions, or experiences about relocation?3Malcolm McLean
2 Jul 24 i i ii ii  +- Re: realloc() - frequency, conditions, or experiences about relocation?1Ben Bacarisse
4 Jul 24 i i ii ii  `- Re: realloc() - frequency, conditions, or experiences about relocation?1Lawrence D'Oliveiro
24 Jun 24 i i ii i`* Re: realloc() - frequency, conditions, or experiences about relocation?2Tim Rentsch
24 Jun 24 i i ii i `- Re: realloc() - frequency, conditions, or experiences about relocation?1David Brown
20 Jun 24 i i ii `* Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiences about relocation?]7Anton Shepelev
20 Jun 24 i i ii  +* Re: Indefinite pronouns3vallor
21 Jun 24 i i ii  i`* Re: Indefinite pronouns2David Brown
21 Jun 24 i i ii  i `- Re: Indefinite pronouns1Keith Thompson
20 Jun 24 i i ii  +* Re: Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiences about relocation?]2Kenny McCormack
20 Jun 24 i i ii  i`- Re: Indefinite pronouns [was: Re: <something technical>]1Janis Papanagnou
21 Jun 24 i i ii  `- Re: Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiences about relocation?]1Tim Rentsch
17 Jun 24 i i i+* Re: realloc() - frequency, conditions, or experiences about relocation?2Richard Harnden
17 Jun 24 i i ii`- Re: realloc() - frequency, conditions, or experiences about relocation?1Chris M. Thomasson
17 Jun 24 i i i`- Re: realloc() - frequency, conditions, or experiences about relocation?1Malcolm McLean
17 Jun 24 i i +* Re: realloc() - frequency, conditions, or experiences about relocation?23Anton Shepelev
18 Jun 24 i i i+- Re: realloc() - frequency, conditions, or experiences about relocation?1David Jones
19 Jun 24 i i i+* Re: realloc() - frequency, conditions, or experiences about relocation?9David Duffy
19 Jun 24 i i ii+* Re: realloc() - frequency, conditions, or experiences about relocation?7Malcolm McLean
19 Jun 24 i i iii+* Re: realloc() - frequency, conditions, or experiences about relocation?4Ben Bacarisse
19 Jun 24 i i iiii`* Re: realloc() - frequency, conditions, or experiences about relocation?3David Brown
19 Jun 24 i i iiii `* Re: realloc() - frequency, conditions, or experiences about relocation?2Ben Bacarisse
20 Jun 24 i i iiii  `- Re: realloc() - frequency, conditions, or experiences about relocation?1David Brown
20 Jun 24 i i iii`* Re: realloc() - frequency, conditions, or experiences about relocation?2Anton Shepelev
8 Jul 24 i i iii `- Re: realloc() - frequency, conditions, or experiences about relocation?1Anton Shepelev
19 Jun 24 i i ii`- Re: realloc() - frequency, conditions, or experiences about relocation?1Anton Shepelev
2 Jul 24 i i i`* Re: realloc() - frequency, conditions, or experiences about relocation?12Rich Ulrich
2 Jul 24 i i i +* Re: realloc() - frequency, conditions, or experiences about relocation?5Keith Thompson
2 Jul 24 i i i i`* Re: realloc() - frequency, conditions, or experiences about relocation?4Rich Ulrich
8 Jul 24 i i i i `* Re: realloc() - frequency, conditions, or experiences about relocation?3Anton Shepelev
22 Jul 24 i i i i  `* Re: realloc() - frequency, conditions, or experiences about relocation?2Rich Ulrich
23 Jul 24 i i i i   `- Re: realloc() - frequency, conditions, or experiences about relocation?1Anton Shepelev
2 Jul 24 i i i `* Re: realloc() - frequency, conditions, or experiences about relocation?6Paul
2 Jul 24 i i i  `* Re: realloc() - frequency, conditions, or experiences about relocation?5Rich Ulrich
2 Jul 24 i i i   `* Re: realloc() - frequency, conditions, or experiences about relocation?4Rich Ulrich
2 Jul 24 i i i    `* Re: realloc() - frequency, conditions, or experiences about relocation?3Paul
2 Jul 24 i i i     +- Re: realloc() - frequency, conditions, or experiences about relocation?1James Kuyper
2 Jul 24 i i i     `- Re: realloc() - frequency, conditions, or experiences about relocation?1James Kuyper
17 Jun 24 i i +- Re: realloc() - frequency, conditions, or experiences about relocation?1Chris M. Thomasson
18 Jun 24 i i `* Re: realloc() - frequency, conditions, or experiences about relocation?3Keith Thompson
18 Jun 24 i i  +- Re: realloc() - frequency, conditions, or experiences about relocation?1Malcolm McLean
18 Jun 24 i i  `- Re: realloc() - frequency, conditions, or experiences about relocation?1Bonita Montero
17 Jun 24 i `- Re: realloc() - frequency, conditions, or experiences about relocation?1David Brown
17 Jun 24 +* Re: realloc() - frequency, conditions, or experiences about relocation?28Bonita Montero
20 Jun 24 i`* Re: realloc() - frequency, conditions, or experiences about relocation?27Vir Campestris
21 Jun 24 i `* Re: realloc() - frequency, conditions, or experiences about relocation?26Bonita Montero
24 Jun 24 i  `* Re: realloc() - frequency, conditions, or experiences about relocation?25Lawrence D'Oliveiro
24 Jun 24 i   +* Re: realloc() - frequency, conditions, or experiences about relocation?21Keith Thompson
24 Jun 24 i   i+* Re: realloc() - frequency, conditions, or experiences about relocation?11David Brown
24 Jun 24 i   ii+* Re: realloc() - frequency, conditions, or experiences about relocation?7Malcolm McLean
24 Jun 24 i   iii+* Re: realloc() - frequency, conditions, or experiences about relocation?3Keith Thompson
25 Jun 24 i   iiii+- Re: realloc() - frequency, conditions, or experiences about relocation?1Malcolm McLean
25 Jun 24 i   iiii`- Re: realloc() - frequency, conditions, or experiences about relocation?1Chris M. Thomasson
25 Jun 24 i   iii`* Re: realloc() - frequency, conditions, or experiences about relocation?3Lawrence D'Oliveiro
25 Jun 24 i   iii `* Re: realloc() - frequency, conditions, or experiences about relocation?2Bonita Montero
26 Jun 24 i   iii  `- Re: realloc() - frequency, conditions, or experiences about relocation?1Lawrence D'Oliveiro
24 Jun 24 i   ii+* Re: realloc() - frequency, conditions, or experiences about relocation?2Chris M. Thomasson
24 Jun 24 i   iii`- Re: realloc() - frequency, conditions, or experiences about relocation?1Bonita Montero
25 Jun 24 i   ii`- Re: realloc() - frequency, conditions, or experiences about relocation?1Lawrence D'Oliveiro
24 Jun 24 i   i+- Re: realloc() - frequency, conditions, or experiences about relocation?1Bonita Montero
25 Jun 24 i   i`* Re: realloc() - frequency, conditions, or experiences about relocation?8Lawrence D'Oliveiro
25 Jun 24 i   i +* Re: realloc() - frequency, conditions, or experiences about relocation?6Keith Thompson
25 Jun 24 i   i i+- Re: realloc() - frequency, conditions, or experiences about relocation?1Richard Damon
28 Jun 24 i   i i+* Re: realloc() - frequency, conditions, or experiences about relocation?2Phil Carmody
28 Jun 24 i   i ii`- Re: realloc() - frequency, conditions, or experiences about relocation?1Keith Thompson
28 Jun 24 i   i i`* Re: realloc() - frequency, conditions, or experiences about relocation?2James Kuyper
28 Jun 24 i   i i `- Re: realloc() - frequency, conditions, or experiences about relocation?1Keith Thompson
28 Jun 24 i   i `- Re: realloc() - frequency, conditions, or experiences about relocation?1James Kuyper
24 Jun 24 i   `* Re: realloc() - frequency, conditions, or experiences about relocation?3Bonita Montero
24 Jun 24 i    `* Down the hall, past the water cooler, third door on the left... (Was: realloc() - frequency, conditions, or experiences about) relocation?2Kenny McCormack
24 Jun 24 i     `- Re: Down the hall, past the water cooler, third door on the left... (Was: realloc() - frequency, conditions, or experiences about) relocation?1Bonita Montero
17 Jun 24 +* Re: realloc() - frequency, conditions, or experiences about relocation?2David Brown
17 Jun 24 i`- Re: realloc() - frequency, conditions, or experiences about relocation?1Bonita Montero
17 Jun 24 +- Re: realloc() - frequency, conditions, or experiences about relocation?1Janis Papanagnou
17 Jun 24 +- Re: realloc() - frequency, conditions, or experiences about relocation?1Michael S
18 Jun 24 +- Re: realloc() - frequency, conditions, or experiences about relocation?1Rosario19
25 Jun 24 `* Re: realloc() - frequency, conditions, or experiences about relocation?7Bonita Montero
25 Jun 24  +* Re: realloc() - frequency, conditions, or experiences about relocation?4Vir Campestris
25 Jun 24  i`* Re: realloc() - frequency, conditions, or experiences about relocation?3Bonita Montero
26 Jun 24  i `* Re: realloc() - frequency, conditions, or experiences about relocation?2Vir Campestris
26 Jun 24  i  `- Re: realloc() - frequency, conditions, or experiences about relocation?1Bonita Montero
25 Jun 24  `* Re: realloc() - frequency, conditions, or experiences about relocation?2DFS
25 Jun 24   `- Re: realloc() - frequency, conditions, or experiences about relocation?1Bonita Montero

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal