Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Q: What's tiny and yellow and very, very, dangerous? A: A canary with the super-user password.


comp / comp.lang.c / Re: realloc() - frequency, conditions, or experiences about relocation?

SubjectAuthor
* realloc() - frequency, conditions, or experiences about relocation?Janis Papanagnou
+* Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
|`* Re: realloc() - frequency, conditions, or experiences about relocation?Vir Campestris
| `* Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
|  `* Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
|   +* Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
|   |+* Re: realloc() - frequency, conditions, or experiences about relocation?David Brown
|   ||+* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
|   |||+* Re: realloc() - frequency, conditions, or experiences about relocation?Scott Lurndal
|   ||||`* Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
|   |||| +- Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
|   |||| `- Re: realloc() - frequency, conditions, or experiences about relocation?Chris M. Thomasson
|   |||`* Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
|   ||| `* Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
|   |||  `- Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
|   ||+* Re: realloc() - frequency, conditions, or experiences about relocation?Chris M. Thomasson
|   |||`- Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
|   ||`- Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
|   |+- Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
|   |`* Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
|   | +* Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
|   | |+- Re: realloc() - frequency, conditions, or experiences about relocation?Richard Damon
|   | |+* Re: realloc() - frequency, conditions, or experiences about relocation?Phil Carmody
|   | ||`- Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
|   | |`* Re: realloc() - frequency, conditions, or experiences about relocation?James Kuyper
|   | | `- Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
|   | `- Re: realloc() - frequency, conditions, or experiences about relocation?James Kuyper
|   `* Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
|    `* Down the hall, past the water cooler, third door on the left... (Was: realloc() Kenny McCormack
|     `- Re: Down the hall, past the water cooler, third door on the left...Bonita Montero
+* Re: realloc() - frequency, conditions, or experiences about relocation?Ben Bacarisse
|`* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| +* Re: realloc() - frequency, conditions, or experiences about relocation?Ben Bacarisse
| |`* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | +* Re: realloc() - frequency, conditions, or experiences about relocation?Ben Bacarisse
| | |+* Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | ||`* Re: realloc() - frequency, conditions, or experiences about relocation?Tim Rentsch
| | || +* Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiences aAnton Shepelev
| | || |+* Re: Indefinite pronounsvallor
| | || ||`* Re: Indefinite pronounsDavid Brown
| | || || `- Re: Indefinite pronounsKeith Thompson
| | || |+- Re: Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiencTim Rentsch
| | || |+- Re: Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiencCri-Cri
| | || |`* Re: Indefinite pronouns [was:Re: realloc() - frequency, conditions, or experiencKenny McCormack
| | || | `- Re: Indefinite pronouns [was: Re: <something technical>]Janis Papanagnou
| | || `* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | ||  +* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | ||  |`* Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
| | ||  | `* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | ||  |  +- Re: realloc() - frequency, conditions, or experiences about relocation?Ben Bacarisse
| | ||  |  `- Re: realloc() - frequency, conditions, or experiences about relocation?Lawrence D'Oliveiro
| | ||  `* Re: realloc() - frequency, conditions, or experiences about relocation?Tim Rentsch
| | ||   `- Re: realloc() - frequency, conditions, or experiences about relocation?David Brown
| | |+* Re: realloc() - frequency, conditions, or experiences about relocation?Richard Harnden
| | ||`- Re: realloc() - frequency, conditions, or experiences about relocation?Chris M. Thomasson
| | |`- Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | +* Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | |+* Re: realloc() - frequency, conditions, or experiences about relocation?David Duffy
| | ||+* Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | |||+* Re: realloc() - frequency, conditions, or experiences about relocation?Ben Bacarisse
| | ||||`* Re: realloc() - frequency, conditions, or experiences about relocation?David Brown
| | |||| `* Re: realloc() - frequency, conditions, or experiences about relocation?Ben Bacarisse
| | ||||  `- Re: realloc() - frequency, conditions, or experiences about relocation?David Brown
| | |||`* Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | ||| `- Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | ||`- Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | |+- Re: realloc() - frequency, conditions, or experiences about relocation?David Jones
| | |`* Re: realloc() - frequency, conditions, or experiences about relocation?Rich Ulrich
| | | +* Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
| | | |`* Re: realloc() - frequency, conditions, or experiences about relocation?Rich Ulrich
| | | | `* Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | | |  `* Re: realloc() - frequency, conditions, or experiences about relocation?Rich Ulrich
| | | |   `- Re: realloc() - frequency, conditions, or experiences about relocation?Anton Shepelev
| | | `* Re: realloc() - frequency, conditions, or experiences about relocation?Paul
| | |  `* Re: realloc() - frequency, conditions, or experiences about relocation?Rich Ulrich
| | |   `* Re: realloc() - frequency, conditions, or experiences about relocation?Rich Ulrich
| | |    `* Re: realloc() - frequency, conditions, or experiences about relocation?Paul
| | |     +- Re: realloc() - frequency, conditions, or experiences about relocation?James Kuyper
| | |     `- Re: realloc() - frequency, conditions, or experiences about relocation?James Kuyper
| | +* Re: realloc() - frequency, conditions, or experiences about relocation?Keith Thompson
| | |+- Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
| | |`- Re: realloc() - frequency, conditions, or experiences about relocation?Malcolm McLean
| | `* Re: realloc() - frequency, conditions, or experiences about relocation?Scott Lurndal
| |  `- Re: realloc() - frequency, conditions, or experiences about relocation?Chris M. Thomasson
| `- Re: realloc() - frequency, conditions, or experiences about relocation?David Brown
+- Re: realloc() - frequency, conditions, or experiences about relocation?Rosario19
+* Re: realloc() - frequency, conditions, or experiences about relocation?Scott Lurndal
|`* Re: realloc() - frequency, conditions, or experiences about relocation?Michael S
| `- Re: realloc() - frequency, conditions, or experiences about relocation?Scott Lurndal
+- Re: realloc() - frequency, conditions, or experiences about relocation?Janis Papanagnou
+* Re: realloc() - frequency, conditions, or experiences about relocation?David Brown
|`- Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
+- Re: realloc() - frequency, conditions, or experiences about relocation?Chris M. Thomasson
`* Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
 +* Re: realloc() - frequency, conditions, or experiences about relocation?Vir Campestris
 |`* Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
 | `* Re: realloc() - frequency, conditions, or experiences about relocation?Vir Campestris
 |  `- Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero
 `* Re: realloc() - frequency, conditions, or experiences about relocation?DFS
  `- Re: realloc() - frequency, conditions, or experiences about relocation?Bonita Montero

Pages:1234
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Lawrence D'Oliv
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Wed, 26 Jun 2024 00:51 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Wed, 26 Jun 2024 00:51:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <v5foms$1pv02$2@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me>
<v4ov8h$j2q2$1@raubtier-asyl.eternal-september.org>
<v52270$2nli8$1@dont-email.me>
<v54jac$3a4p2$1@raubtier-asyl.eternal-september.org>
<v5bbd3$rhao$2@dont-email.me> <875xtyu0kk.fsf@nosuchdomain.example.com>
<v5bluo$thpd$1@dont-email.me> <v5cbkn$11tla$1@dont-email.me>
<v5dqa0$1eh23$12@dont-email.me>
<v5dvm3$1fo3c$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 26 Jun 2024 02:51:41 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d3e70b79bcb23d33c66caba9f2139d60";
logging-data="1899522"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+yUG/VcmNmHM9rO2SW1g6c"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:qg+wQsWOr8RTGA5tuj/oex0j+8A=
View all headers

On Tue, 25 Jun 2024 10:38:28 +0200, Bonita Montero wrote:

> Am 25.06.2024 um 09:06 schrieb Lawrence D'Oliveiro:
>
>> I wrote a memory-hog app for Android once, and found that allocating
>> large amounts of memory space had very little impact on the system.
>> Then when I added code to actually write data into those allocated
>> pages, that’s when it really started to break into a sweat ...
>
> Then android is also doing overcommit.

It is running a Linux kernel, and that tends to be the default setup in
Linux.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Vir Campestris
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Wed, 26 Jun 2024 11:15 UTC
References: 1 2 3 4
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: vir.campestris@invalid.invalid (Vir Campestris)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Wed, 26 Jun 2024 12:15:33 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <v5gt8l$23d7q$3@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me>
<v5e090$1fr82$1@raubtier-asyl.eternal-september.org>
<v5e7m6$1gt2p$3@dont-email.me>
<v5e9li$1hil5$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 26 Jun 2024 13:15:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="33717825154947d0235c868c3b1181dd";
logging-data="2209018"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UjZDOkCPU8ZyfTxyyf5sOfDvmvm4zISM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:hTtjgBuJZu43pQt5ARFWkMdUWrQ=
In-Reply-To: <v5e9li$1hil5$1@raubtier-asyl.eternal-september.org>
Content-Language: en-GB
View all headers

On 25/06/2024 12:28, Bonita Montero wrote:
>
> The interesting part is that after doing the first realloc()
> the memory being freee isn't reused for the next malloc().

That's entirely implementation dependent.

Andy

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Bonita Montero
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Wed, 26 Jun 2024 13:01 UTC
References: 1 2 3 4 5
Path: eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Wed, 26 Jun 2024 15:01:21 +0200
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <v5h3f1$252hk$1@raubtier-asyl.eternal-september.org>
References: <v4ojs8$gvji$1@dont-email.me>
<v5e090$1fr82$1@raubtier-asyl.eternal-september.org>
<v5e7m6$1gt2p$3@dont-email.me>
<v5e9li$1hil5$1@raubtier-asyl.eternal-september.org>
<v5gt8l$23d7q$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 26 Jun 2024 15:01:21 +0200 (CEST)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="162d8ca6299ff75b70e00c492c2e1727";
logging-data="2263604"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/gyQSQ07xTlP2KvPxY+bS7HJQ1YIfZO5Q="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gWmv6ho0I/CxL06qi86bqhTnbPY=
In-Reply-To: <v5gt8l$23d7q$3@dont-email.me>
Content-Language: de-DE
View all headers

Am 26.06.2024 um 13:15 schrieb Vir Campestris:
> On 25/06/2024 12:28, Bonita Montero wrote:
>>
>> The interesting part is that after doing the first realloc()
>> the memory being freee isn't reused for the next malloc().
>
> That's entirely implementation dependent.

Of course, but that's what I wanted to test.
I traced the allocations with strace and the memory after the single
byte step actually is really freed and not marked as discardable.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Phil Carmody
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 08:01 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: pc+usenet@asdf.org (Phil Carmody)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Fri, 28 Jun 2024 11:01:38 +0300
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <87le2p5wd9.fsf@fatphil.org>
References: <v4ojs8$gvji$1@dont-email.me>
<v4ov8h$j2q2$1@raubtier-asyl.eternal-september.org>
<v52270$2nli8$1@dont-email.me>
<v54jac$3a4p2$1@raubtier-asyl.eternal-september.org>
<v5bbd3$rhao$2@dont-email.me>
<875xtyu0kk.fsf@nosuchdomain.example.com>
<v5dq2e$1eh23$11@dont-email.me>
<87frt1tk0z.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 28 Jun 2024 10:17:26 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d4dc9bc4add6a62e4024cbb3babf20e6";
logging-data="3433464"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KlF1aTXDK9kT+yeq3jSem"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
Cancel-Lock: sha1:GTLycxsm0CzzYxgXfvGJO5URXZ0=
sha1:91XU2IKmSrfu+62Z3c4eXmQzyaw=
View all headers

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
> Suppose you do something like:
>
> some_type *p = malloc(BIG_VALUE);
> // ...
> p = realloc(p, SMALL_VALUE);
>
> ... If realloc() succeeds and *does* relocate the object, p
> still points to memory that has now been deallocated, and you don't have
> a pointer to the newly allocated memory.

Surely some mistake?

However, such self-assignments are bad for the reasons you state later;
verify, then update.

Phil
--
We are no longer hunters and nomads. No longer awed and frightened, as we have
gained some understanding of the world in which we live. As such, we can cast
aside childish remnants from the dawn of our civilization.
-- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: James Kuyper
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 10:36 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Fri, 28 Jun 2024 06:36:45 -0400
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <v5m3nt$39uf0$1@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me>
<v4ov8h$j2q2$1@raubtier-asyl.eternal-september.org>
<v52270$2nli8$1@dont-email.me>
<v54jac$3a4p2$1@raubtier-asyl.eternal-september.org>
<v5bbd3$rhao$2@dont-email.me> <875xtyu0kk.fsf@nosuchdomain.example.com>
<v5dq2e$1eh23$11@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 28 Jun 2024 12:36:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f8990298274f77e7d70135a2bd7c323c";
logging-data="3471840"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ijASGjwc0Fue20x2zXsTPcIg25l960is="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0pDyr9VFK5Bpv9WBA9rBeA2sokQ=
In-Reply-To: <v5dq2e$1eh23$11@dont-email.me>
Content-Language: en-US
View all headers

On 6/25/24 03:02, Lawrence D'Oliveiro wrote:
> On Mon, 24 Jun 2024 02:55:39 -0700, Keith Thompson wrote:
....
>> Having said all that, if realloc fails (indicated by returning a null
>> pointer), you still have the original pointer to the object.
>
> In other words, it’s safe to ignore any error from that last shrinking
> realloc? That’s good enough for me. ;)

No, you misunderstand:

q = realloc(p, SMALL_VALUE);

Then if q is null, p still points at the originally allocated memory. If
q is not null, then it may point at newly allocated memory, and p has in
indeterminate value. You cannot go forward ignoring the possibility that
no new object was allocated, because if you do, you have no way of
knowing which of the two pointers you can safely dereference. You need,
at least,

if(q)
p = q;

then you can safely use p, regardless of whether realloc() allocated new
memory.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: James Kuyper
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Fri, 28 Jun 2024 10:37 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Fri, 28 Jun 2024 06:37:49 -0400
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <v5m3pt$39uf0$2@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me>
<v4ov8h$j2q2$1@raubtier-asyl.eternal-september.org>
<v52270$2nli8$1@dont-email.me>
<v54jac$3a4p2$1@raubtier-asyl.eternal-september.org>
<v5bbd3$rhao$2@dont-email.me> <875xtyu0kk.fsf@nosuchdomain.example.com>
<v5dq2e$1eh23$11@dont-email.me> <87frt1tk0z.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 28 Jun 2024 12:37:50 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f8990298274f77e7d70135a2bd7c323c";
logging-data="3471840"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WiO5WqCFx5WShQQJgYXZtOb7UuU7ZrSY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Z28ApjO96I3UxY1ExVMo81w2Mco=
Content-Language: en-US
In-Reply-To: <87frt1tk0z.fsf@nosuchdomain.example.com>
View all headers

On 6/25/24 06:05, Keith Thompson wrote:
....
> Suppose you do something like:
>
> some_type *p = malloc(BIG_VALUE);
> // ...
> p = realloc(p, SMALL_VALUE);
>
> If the realloc() succeeds and doesn't relocate and copy the object,
> you're fine. If realloc() succeeds and *does* relocate the object, p
> still points to memory that has now been deallocated, and you don't have
> a pointer to the newly allocated memory. ...

? I believe that, in that case, p does point to the newly allocated memory.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Keith Thompson
Newsgroups: comp.lang.c
Organization: None to speak of
Date: Fri, 28 Jun 2024 11:04 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Fri, 28 Jun 2024 04:04:48 -0700
Organization: None to speak of
Lines: 31
Message-ID: <87le2pxr8v.fsf@nosuchdomain.example.com>
References: <v4ojs8$gvji$1@dont-email.me>
<v4ov8h$j2q2$1@raubtier-asyl.eternal-september.org>
<v52270$2nli8$1@dont-email.me>
<v54jac$3a4p2$1@raubtier-asyl.eternal-september.org>
<v5bbd3$rhao$2@dont-email.me>
<875xtyu0kk.fsf@nosuchdomain.example.com>
<v5dq2e$1eh23$11@dont-email.me>
<87frt1tk0z.fsf@nosuchdomain.example.com> <87le2p5wd9.fsf@fatphil.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 28 Jun 2024 13:04:49 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6806d4f1a7ac43603fc89328bbed09d0";
logging-data="3484462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wG+aLR6/BzvN16gVwbTS/"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:/Jql4Ky6jyjmN+2A1HlqqgAtDfk=
sha1:4gt0h9tCfN6Dz66Y923zOuAWmUg=
View all headers

Phil Carmody <pc+usenet@asdf.org> writes:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>> Suppose you do something like:
>>
>> some_type *p = malloc(BIG_VALUE);
>> // ...
>> p = realloc(p, SMALL_VALUE);
>>
>> ... If realloc() succeeds and *does* relocate the object, p
>> still points to memory that has now been deallocated, and you don't have
>> a pointer to the newly allocated memory.
>
> Surely some mistake?

Yes, and thanks for catching it.

If realloc() succeeds, p points to the newly allocated memory; you no
longer have a pointer to the old deallocated memory, but that's a good
thing.

I think I was describing the behavior of calling realloc(p, SMALL_VALUE)
without assigning the result to anything.

> However, such self-assignments are bad for the reasons you state later;
> verify, then update.

Right.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Keith Thompson
Newsgroups: comp.lang.c
Organization: None to speak of
Date: Fri, 28 Jun 2024 11:05 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Fri, 28 Jun 2024 04:05:40 -0700
Organization: None to speak of
Lines: 21
Message-ID: <87h6ddxr7f.fsf@nosuchdomain.example.com>
References: <v4ojs8$gvji$1@dont-email.me>
<v4ov8h$j2q2$1@raubtier-asyl.eternal-september.org>
<v52270$2nli8$1@dont-email.me>
<v54jac$3a4p2$1@raubtier-asyl.eternal-september.org>
<v5bbd3$rhao$2@dont-email.me>
<875xtyu0kk.fsf@nosuchdomain.example.com>
<v5dq2e$1eh23$11@dont-email.me>
<87frt1tk0z.fsf@nosuchdomain.example.com>
<v5m3pt$39uf0$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Fri, 28 Jun 2024 13:05:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6806d4f1a7ac43603fc89328bbed09d0";
logging-data="3484462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WQtMXlcFEwvfwfHVyzN2P"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:F4VEC0m3Uzdu1sLpxF2XYjVPiec=
sha1:OZTO88G+ooSI3EOB071cA4QSfRc=
View all headers

James Kuyper <jameskuyper@alumni.caltech.edu> writes:
> On 6/25/24 06:05, Keith Thompson wrote:
> ...
>> Suppose you do something like:
>>
>> some_type *p = malloc(BIG_VALUE);
>> // ...
>> p = realloc(p, SMALL_VALUE);
>>
>> If the realloc() succeeds and doesn't relocate and copy the object,
>> you're fine. If realloc() succeeds and *does* relocate the object, p
>> still points to memory that has now been deallocated, and you don't have
>> a pointer to the newly allocated memory. ...
>
> ? I believe that, in that case, p does point to the newly allocated memory.

Yes, my mistake.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Lawrence D'Oliv
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Sat, 29 Jun 2024 00:14 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Sat, 29 Jun 2024 00:14:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <v5njll$3ilq3$4@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me> <87tthrvdtg.fsf@bsb.me.uk>
<20240617181034.74fb4cca1f4a9a3ea032825e@g{oogle}mail.com>
<86r0cuk9qz.fsf@linuxsc.com> <v4rmv0$19t6u$1@dont-email.me>
<v4roic$1ad0g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 29 Jun 2024 02:14:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a2cc8132046870bc3bf66319a7891d10";
logging-data="3757891"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4SL7bdlvC5VKH61oS25rL"
User-Agent: Pan/0.158 (Avdiivka; )
Cancel-Lock: sha1:Ml9GtzKU32jrikCpUTkKfvsPvSI=
View all headers

On Tue, 18 Jun 2024 11:46:36 +0100, Malcolm McLean wrote:

> 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

I don’t see any error bars. Without those, it hard to attach any
significance to the differences in figures.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Rich Ulrich
Newsgroups: comp.lang.c, sci.stat.math
Date: Tue, 2 Jul 2024 04:51 UTC
References: 1 2 3 4 5 6
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!nntp.giganews.com!local-3.nntp.ord.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Jul 2024 04:51:33 +0000
From: rich.ulrich@comcast.net (Rich Ulrich)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Tue, 02 Jul 2024 00:51:33 -0400
Message-ID: <s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk> <v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk> <v4pb4v$lhgk$1@dont-email.me> <20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 30
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-XS33sEDuddWzNEnbSIooDZAxYztlwDuMNj89prhHlacwo30RPdeOFM/T580VvZ+bT9BDS4rLJAF9zsy!AekJQsIGTJtkAwXuKclKrFwyreRJq06gwp7z7W0wVQ9MTMtqhsxiNmq78blLdPaCkgFYISs=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Mon, 17 Jun 2024 18:02:49 +0300, Anton Shepelev
<anton.txt@g{oogle}mail.com> wrote:

>[cross-posted to: ci.stat.math]
>
Anton,

The post being responded to was originally to comp.lang.c
which I don't subscribe to.

I have a question that I suppose reflects on my news source,
GigaNews, or else on my reader, Forte Agent.

Was this thread something posted 15 or 20 years ago?

I tried to call up the original post by clicking on the Message
ID when looking at headers; nothing comes up when Agent goes
online to look. The header shows multiple earlier messages;
none of them come up for me.

My clicking on Message ID works elsewhere. The logical and
simple explanation is that this is a thread old enough that
GigaNews does not have it.

I suppose that someone else might be able to tell me, if their
supplier goes back further or if GigaNews is somehow failing
to show me something that is recent.

--
Rich Ulrich

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Keith Thompson
Newsgroups: comp.lang.c, sci.stat.math
Organization: None to speak of
Date: Tue, 2 Jul 2024 05:10 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S.Thompson+u@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Mon, 01 Jul 2024 22:10:00 -0700
Organization: None to speak of
Lines: 39
Message-ID: <87le2kwf9z.fsf@nosuchdomain.example.com>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Date: Tue, 02 Jul 2024 07:10:07 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a98783fc5e0fb925d62531fe92c7b3bb";
logging-data="1596868"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185BzMWibB2kszWIDLpzIdo"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:zOkCoov9O4/gtC2zJFyS3nZYgAM=
sha1:7qwC8F9wqU4jOP/FCLK3Nk2g4+8=
View all headers

Rich Ulrich <rich.ulrich@comcast.net> writes:
> On Mon, 17 Jun 2024 18:02:49 +0300, Anton Shepelev
> <anton.txt@g{oogle}mail.com> wrote:
>
>>[cross-posted to: ci.stat.math]
>>
> Anton,
>
> The post being responded to was originally to comp.lang.c
> which I don't subscribe to.
>
> I have a question that I suppose reflects on my news source,
> GigaNews, or else on my reader, Forte Agent.
>
> Was this thread something posted 15 or 20 years ago?
>
> I tried to call up the original post by clicking on the Message
> ID when looking at headers; nothing comes up when Agent goes
> online to look. The header shows multiple earlier messages;
> none of them come up for me.
>
> My clicking on Message ID works elsewhere. The logical and
> simple explanation is that this is a thread old enough that
> GigaNews does not have it.
>
> I suppose that someone else might be able to tell me, if their
> supplier goes back further or if GigaNews is somehow failing
> to show me something that is recent.

The first article in this thread was posted to comp.lang.c by Janis
Papanagnou on 17 Jun 2024.

There were several followups on the same day. The diret parent of your
article was cross-posted to comp.lang.c and sci.stat.math by Anton
Shepelev (his was the first cross-posted article in the thread).

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
void Void(void) { Void(); } /* The recursive call of the void */

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Paul
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 07:02 UTC
References: 1 2 3 4 5 6 7
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Tue, 2 Jul 2024 03:02:07 -0400
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <v608lg$1hrve$1@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 02 Jul 2024 09:02:09 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="aca64d9d071c32fd4132aecac4cdb8f8";
logging-data="1634286"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FmSVPrELEP+mHN2Sw7XVlFLhzpYM5RLA="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:AbVm/SopYg4k1jG5lTWwuaFigks=
In-Reply-To: <s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com>
Content-Language: en-US
View all headers

On 7/2/2024 12:51 AM, Rich Ulrich wrote:
> On Mon, 17 Jun 2024 18:02:49 +0300, Anton Shepelev
> <anton.txt@g{oogle}mail.com> wrote:
>
>> [cross-posted to: ci.stat.math]
>>
> Anton,
>
> The post being responded to was originally to comp.lang.c
> which I don't subscribe to.
>
> I have a question that I suppose reflects on my news source,
> GigaNews, or else on my reader, Forte Agent.
>
> Was this thread something posted 15 or 20 years ago?
>
> I tried to call up the original post by clicking on the Message
> ID when looking at headers; nothing comes up when Agent goes
> online to look. The header shows multiple earlier messages;
> none of them come up for me.
>
> My clicking on Message ID works elsewhere. The logical and
> simple explanation is that this is a thread old enough that
> GigaNews does not have it.
>
> I suppose that someone else might be able to tell me, if their
> supplier goes back further or if GigaNews is somehow failing
> to show me something that is recent.
>

MID: <v4ojs8$gvji$1@dont-email.me>

http://al.howardknight.net/

That gives this URL, as a copy of the message kicking off the thread.

http://al.howardknight.net/?STYPE=msgid&MSGI=%3Cv4ojs8%24gvji%241%40dont-email.me%3E

Some USENET News clients can work from the MID directly, but Thunderbird does not.
A bare MID does not work for everyone.

Paul

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Malcolm McLean
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 09:18 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: malcolm.arthur.mclean@gmail.com (Malcolm McLean)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Tue, 2 Jul 2024 10:18:32 +0100
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <v60gl9$1j1qq$1@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me> <87tthrvdtg.fsf@bsb.me.uk>
<20240617181034.74fb4cca1f4a9a3ea032825e@g{oogle}mail.com>
<86r0cuk9qz.fsf@linuxsc.com> <v4rmv0$19t6u$1@dont-email.me>
<v4roic$1ad0g$1@dont-email.me> <v5njll$3ilq3$4@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 02 Jul 2024 11:18:33 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="973ad6b9779674a2d016f6d176718560";
logging-data="1673050"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XtlmhAFUK0zSaTXUtJrq5Ep32Nnx+ImY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1G13o/+Kg6yjbd4XUlKDOP+8wrg=
In-Reply-To: <v5njll$3ilq3$4@dont-email.me>
Content-Language: en-GB
View all headers

On 29/06/2024 01:14, Lawrence D'Oliveiro wrote:
> On Tue, 18 Jun 2024 11:46:36 +0100, Malcolm McLean wrote:
>
>> 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
>
> I don’t see any error bars. Without those, it hard to attach any
> significance to the differences in figures.
>
You don't need error bars becuase those fugures indicate a distribution.
The file are log-normally distributed wth given means and median. So the
spread is part of that data.

(Strictly you do need N to assess the significance, but it's got to be
one in a fazilion, the null that there is no difference at all in file
sizes between the platforms doesn't have a prayer. Unless you argue that
because the files came from one machine each, N is actualy 1).

--
Check out my hobby project.
http://malcolmmclean.github.io/babyxrc

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Ben Bacarisse
Newsgroups: comp.lang.c
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 15:39 UTC
References: 1 2 3 4 5 6 7 8 9 10 11 12
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ben@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.lang.c
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Tue, 02 Jul 2024 16:39:21 +0100
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <87wmm3kdli.fsf@bsb.me.uk>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me> <87tthrvdtg.fsf@bsb.me.uk>
<20240617181034.74fb4cca1f4a9a3ea032825e@g{oogle}mail.com>
<86r0cuk9qz.fsf@linuxsc.com> <v4rmv0$19t6u$1@dont-email.me>
<v4roic$1ad0g$1@dont-email.me> <v5njll$3ilq3$4@dont-email.me>
<v60gl9$1j1qq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 02 Jul 2024 17:39:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="b266bd3b753af90a68a6f95ab3ce5341";
logging-data="1774095"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18QXxs/n5oDMZlUCPqEhlcrn8Rb5JzPBik="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:PNGP0+aFrgUGcvlCKriISNVzPpA=
sha1:oaqP2JjqbS792xLtawhM1vhqqvo=
X-BSB-Auth: 1.1cc2431d8f812f3b5555.20240702163921BST.87wmm3kdli.fsf@bsb.me.uk
View all headers

Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:

> On 29/06/2024 01:14, Lawrence D'Oliveiro wrote:
>> On Tue, 18 Jun 2024 11:46:36 +0100, Malcolm McLean wrote:
>>
>>> 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
>> I don’t see any error bars. Without those, it hard to attach any
>> significance to the differences in figures.
>>
> You don't need error bars becuase those fugures indicate a
> distribution. The file are log-normally distributed wth given means
> and median. So the spread is part of that data.

There are (or should be) two different distributions. Error bars are
intended to show the spread within the data. The log normal
distribution is across the data.

Now I suspect they didn't do it this way and just amalgamated all the
file save data into one, but that explains rather than excuses the lack
of error bars!

--
Ben.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Rich Ulrich
Newsgroups: comp.lang.c, sci.stat.math
Date: Tue, 2 Jul 2024 15:45 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!local-2.nntp.ord.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Jul 2024 15:45:24 +0000
From: rich.ulrich@comcast.net (Rich Ulrich)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Tue, 02 Jul 2024 11:45:25 -0400
Message-ID: <qa788jp18m80t3ltd29aaokhmp0l4sop40@4ax.com>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk> <v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk> <v4pb4v$lhgk$1@dont-email.me> <20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com> <s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <87le2kwf9z.fsf@nosuchdomain.example.com>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 52
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-9ryybs8XYG4f8TCfWQ1x+cXl7jDID6NSPjErtAHl8UJEJbO2knH2ztAZ1fNqHk6JWQooTAVdMK22ztQ!y8nPZJrPEPErxB+tvq4pgkoL/9r5VAVft9iczgd5e/88lOV9rcqIPrLSuWW1AboVWQAJwck=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Mon, 01 Jul 2024 22:10:00 -0700, Keith Thompson
<Keith.S.Thompson+u@gmail.com> wrote:

>Rich Ulrich <rich.ulrich@comcast.net> writes:
>> On Mon, 17 Jun 2024 18:02:49 +0300, Anton Shepelev
>> <anton.txt@g{oogle}mail.com> wrote:
>>
>>>[cross-posted to: ci.stat.math]
>>>
>> Anton,
>>
>> The post being responded to was originally to comp.lang.c
>> which I don't subscribe to.
>>
>> I have a question that I suppose reflects on my news source,
>> GigaNews, or else on my reader, Forte Agent.
>>
>> Was this thread something posted 15 or 20 years ago?
>>
>> I tried to call up the original post by clicking on the Message
>> ID when looking at headers; nothing comes up when Agent goes
>> online to look. The header shows multiple earlier messages;
>> none of them come up for me.
>>
>> My clicking on Message ID works elsewhere. The logical and
>> simple explanation is that this is a thread old enough that
>> GigaNews does not have it.
>>
>> I suppose that someone else might be able to tell me, if their
>> supplier goes back further or if GigaNews is somehow failing
>> to show me something that is recent.
>
>The first article in this thread was posted to comp.lang.c by Janis
>Papanagnou on 17 Jun 2024.
>
>There were several followups on the same day. The diret parent of your
>article was cross-posted to comp.lang.c and sci.stat.math by Anton
>Shepelev (his was the first cross-posted article in the thread).

Thanks, so it looks like a failure by GigaNews to retrieve the
recent posts.

I did see a bunch of cross-posted followups. I don't know C,
and I thought there could be more context.

Looking at original, absent posts is something I've done dozens
of times over the years. Never a problem, except fora time or two
with posts from the 1990s. I've used GigaNews since my regular
ISP stopped providing Usenet access, maybe 15 years ago.

--
Rich Ulrich

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Rich Ulrich
Newsgroups: comp.lang.c, sci.stat.math
Date: Tue, 2 Jul 2024 15:52 UTC
References: 1 2 3 4 5 6 7 8
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Jul 2024 15:52:56 +0000
From: rich.ulrich@comcast.net (Rich Ulrich)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Tue, 02 Jul 2024 11:52:56 -0400
Message-ID: <l5888j1gma8soa327bi31tge8d7kmr9jsj@4ax.com>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk> <v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk> <v4pb4v$lhgk$1@dont-email.me> <20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com> <s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <v608lg$1hrve$1@dont-email.me>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 57
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-zfi0bUpQnAZ1hqH+zH+Tf/clKzb1P0zNiYRiC2YQ621SSe2Y9NNa1l/JS0KrbJnP4I5qyiT2K63QgGh!xaLK58Pnr068Zr6wqTqQA5vLryCMVjcgO1vWWPx9ytemi0zwV8slvVn+oVCL19q4ZSYIsV4=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Tue, 2 Jul 2024 03:02:07 -0400, Paul <nospam@needed.invalid> wrote:

>On 7/2/2024 12:51 AM, Rich Ulrich wrote:
>> On Mon, 17 Jun 2024 18:02:49 +0300, Anton Shepelev
>> <anton.txt@g{oogle}mail.com> wrote:
>>
>>> [cross-posted to: ci.stat.math]
>>>
>> Anton,
>>
>> The post being responded to was originally to comp.lang.c
>> which I don't subscribe to.
>>
>> I have a question that I suppose reflects on my news source,
>> GigaNews, or else on my reader, Forte Agent.
>>
>> Was this thread something posted 15 or 20 years ago?
>>
>> I tried to call up the original post by clicking on the Message
>> ID when looking at headers; nothing comes up when Agent goes
>> online to look. The header shows multiple earlier messages;
>> none of them come up for me.
>>
>> My clicking on Message ID works elsewhere. The logical and
>> simple explanation is that this is a thread old enough that
>> GigaNews does not have it.
>>
>> I suppose that someone else might be able to tell me, if their
>> supplier goes back further or if GigaNews is somehow failing
>> to show me something that is recent.
>>
>
>MID: <v4ojs8$gvji$1@dont-email.me>
>
>http://al.howardknight.net/
>
>That gives this URL, as a copy of the message kicking off the thread.
>
> http://al.howardknight.net/?STYPE=msgid&MSGI=%3Cv4ojs8%24gvji%241%40dont-email.me%3E
>

Yes, that's the message I see when I plug the Message ID
into the program at http://al.howardknight.net/

Thanks. I'm saving that.

>Some USENET News clients can work from the MID directly, but Thunderbird does not.
>A bare MID does not work for everyone.

Forte Agent invites me to click on the MID; asks if it is a
mail or MID; asks if it should search the net. It still works
when I test it on an old message in another group.

--
Rich Ulrich

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Rich Ulrich
Newsgroups: comp.lang.c, sci.stat.math
Date: Tue, 2 Jul 2024 15:58 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 02 Jul 2024 15:58:10 +0000
From: rich.ulrich@comcast.net (Rich Ulrich)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Tue, 02 Jul 2024 11:58:11 -0400
Message-ID: <hm888jphepmpqpqk4n55rov8n5fhjjshhj@4ax.com>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk> <v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk> <v4pb4v$lhgk$1@dont-email.me> <20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com> <s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <v608lg$1hrve$1@dont-email.me> <l5888j1gma8soa327bi31tge8d7kmr9jsj@4ax.com>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 16
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-K4jh8h/jkhAif2u+lm1NIdatbInDhQKD8oXyex8yy/T4vc17CTmLaBi+ZyyWuZuHOb/Hmmv2JgxuN2V!NAn+/3DTgU2N8rPCPqFW2Wp1li1+V7oQGnYv40fgFDQ9tKsUYjfKzcOA2NuEQRJ/emAPJgw=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Tue, 02 Jul 2024 11:52:56 -0400, Rich Ulrich
<rich.ulrich@comcast.net> wrote:

>
>Forte Agent invites me to click on the MID; asks if it is a
>mail or MID; asks if it should search the net. It still works
>when I test it on an old message in another group.
>

Now it occurs to me -- It actually does make sense,
economically, if what is searched online is limited the
groups I subscribe to, or (even) only the group that
is currently active.

--
Rich Ulrich

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Paul
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 19:09 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam@needed.invalid (Paul)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Tue, 2 Jul 2024 15:09:25 -0400
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <v61j97$1oo17$1@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <v608lg$1hrve$1@dont-email.me>
<l5888j1gma8soa327bi31tge8d7kmr9jsj@4ax.com>
<hm888jphepmpqpqk4n55rov8n5fhjjshhj@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 02 Jul 2024 21:09:28 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="aca64d9d071c32fd4132aecac4cdb8f8";
logging-data="1859623"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19VMSIuZnya+r1L+V4tFS6CiS/rgFbQYKA="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:EPBkvUMI3ezuhLemejMknDkDRfc=
In-Reply-To: <hm888jphepmpqpqk4n55rov8n5fhjjshhj@4ax.com>
Content-Language: en-US
View all headers

On 7/2/2024 11:58 AM, Rich Ulrich wrote:
> On Tue, 02 Jul 2024 11:52:56 -0400, Rich Ulrich
> <rich.ulrich@comcast.net> wrote:
>
>>
>> Forte Agent invites me to click on the MID; asks if it is a
>> mail or MID; asks if it should search the net. It still works
>> when I test it on an old message in another group.
>>
>
> Now it occurs to me -- It actually does make sense,
> economically, if what is searched online is limited the
> groups I subscribe to, or (even) only the group that
> is currently active.
>

Every device has "retention", but retention is limited.

Whether it's a search site, or a USENET server (even Forte had
their own news server, at one time), you need retention for
older articles to be search-able either as body text, or as
a <mid>.

Now that Google Groups is no longer connected to USENET,
that's one fewer places with a decent-sized archive. Google closed
their service, after the ThaiSpam incident. The Eternal-September
server, changed from one server to a two-server setup. The
Transit Server had Spam Assassin loaded on it, removing THaiSpam,
and the second server continued to offer normal ("filtered") service.

The comp.lang.c group was one of the groups under attack. Since
Google was letting the spam in, now that Google is disconnected,
the spam is gone, and the readership on CLC has gone up.

Paul

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: James Kuyper
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 20:54 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Tue, 2 Jul 2024 16:54:46 -0400
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <v61pem$1pm4j$1@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <v608lg$1hrve$1@dont-email.me>
<l5888j1gma8soa327bi31tge8d7kmr9jsj@4ax.com>
<hm888jphepmpqpqk4n55rov8n5fhjjshhj@4ax.com> <v61j97$1oo17$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 02 Jul 2024 22:54:46 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d5c95c1317fa975b93ba1eaa31d1cfd6";
logging-data="1890451"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MWGFFSLNXq0yCE0bSUCssbVBpE5dQDA4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:GOMuo//WraTv7JpAmh+k3nptmSQ=
Content-Language: en-US
In-Reply-To: <v61j97$1oo17$1@dont-email.me>
View all headers

On 7/2/24 15:09, Paul wrote:
....
> Now that Google Groups is no longer connected to USENET,

I just checked, and as I had expected, Google is still connected.

> that's one fewer places with a decent-sized archive. Google closed
> their service, after the ThaiSpam incident.

They didn't close their service. They just stopped adding new messages
to their archives. The messages that were stored prior to the closing
are still available for searching.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: James Kuyper
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Tue, 2 Jul 2024 20:58 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: jameskuyper@alumni.caltech.edu (James Kuyper)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Tue, 2 Jul 2024 16:58:14 -0400
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <v61pl6$1pm4j$2@dont-email.me>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <v608lg$1hrve$1@dont-email.me>
<l5888j1gma8soa327bi31tge8d7kmr9jsj@4ax.com>
<hm888jphepmpqpqk4n55rov8n5fhjjshhj@4ax.com> <v61j97$1oo17$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 02 Jul 2024 22:58:18 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d5c95c1317fa975b93ba1eaa31d1cfd6";
logging-data="1890451"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jBt3W9Lu/3ldqqRXo1aBTJQg0W4mnPM8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:VcbZsclK2h9YPVYpQpH3CpjHHNA=
In-Reply-To: <v61j97$1oo17$1@dont-email.me>
Content-Language: en-US
View all headers

On 7/2/24 15:09, Paul wrote:
....
> Now that Google Groups is no longer connected to USENET,
....
> that's one fewer places with a decent-sized archive. Google closed
> their service, after the ThaiSpam incident.

While they no longer store new messages, they still have one of the
largest archives of old messages, and it's still available for searching.

Subject:
From:
Newsgroups:
Date: Thu, 30 Jan 2025 23:48 UTC
> spread is part of that data.
View all headers

That’s an assumption of the parametric fit, not a fact of the data. Error
bars would indicate how close the fit is.

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Anton Shepelev
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Mon, 8 Jul 2024 16:34 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton.txt@g{oogle}mail.com (Anton Shepelev)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Mon, 8 Jul 2024 19:34:56 +0300
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <20240708193456.a1ebe2d0872239c525120d84@g{oogle}mail.com>
References: <v4ojs8$gvji$1@dont-email.me>
<875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me>
<87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<v4tuvf$1qto5$1@dont-email.me>
<v4u7dm$1t2pu$1@dont-email.me>
<20240620015347.9bdcc4df03ab63d096375450@gmail.moc>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 08 Jul 2024 18:34:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="46dbe6ab9786220f9431ea65e0802f88";
logging-data="1007462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dW5OrM9YwP9VEUxwAYzRfAOolvMyNtVk="
Cancel-Lock: sha1:9pHXKQsEvabZtBG4GdPejG6e5Sg=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
View all headers

I had plumb forgot about this solution of mine:

> p0 = 1-e^(L*x0) ,
> p1 = 1-e^(L*x1) ,
> x1 = k*x0 (by our strategy), =>
> p1 = 1-(1-p0)^k .
>
> which does not depend on the distribution and lets us
> generalise this approach for any distribution:
>
> x1 = Q( 1 - ( 1 - CDF(x0) )^k )
> where:
>
> x0 : the required size
> x1 : the new recommended capacity
> Q(p) : the p-Quantile of the given distribution
> CDF(x): the CDF of the given distribution
> k>1 : balance between speed and space efficiency

Let us test it with the exponential distribution, for which:

Q (p) = -Ln( 1 - p )/L
CDF(x) = 1 - e^(-Lx)

Substituting these into the equation for x1:

x1 = Q ( 1 - ( 1 - ( 1 - e^(-Lx0) ) )^k ) =
Q ( 1 - ( e^(-Lx0) )^k ) =
Q ( 1 - e^(-kLx0) ) =
-Ln( e^(-kLx0) )/L = k*x0 (QED)

That is, my solution is a/the generalisation of the
exponential growth strategy.

--
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Anton Shepelev
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Mon, 8 Jul 2024 17:01 UTC
References: 1 2 3 4 5 6 7 8 9
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton.txt@g{oogle}mail.com (Anton Shepelev)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Mon, 8 Jul 2024 20:01:21 +0300
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <20240708200121.ec07d0338a336b56cc7387a1@g{oogle}mail.com>
References: <v4ojs8$gvji$1@dont-email.me>
<875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me>
<87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com>
<87le2kwf9z.fsf@nosuchdomain.example.com>
<qa788jp18m80t3ltd29aaokhmp0l4sop40@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 08 Jul 2024 19:01:23 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="46dbe6ab9786220f9431ea65e0802f88";
logging-data="1007462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FwxAQMrpwlRqIwz5fQ80rA1c4bQy3OIQ="
Cancel-Lock: sha1:LJR3g9+jFTuuioYdV0vD2kR8Yw4=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
View all headers

Rich Ulrich:

> Thanks, so it looks like a failure by GigaNews to retrieve
> the recent posts.
>
> I did see a bunch of cross-posted followups. I don't know
> C, and I thought there could be more context.

Characters are being read in (say, from a file) sequentially
and stored in computer memory (RAM) in an "array" -- a
linear data structure storing elements (our characters) in a
sequential order, one ofter the other at addresses with
increasing indexes -- somewhat like a mathematical vector.

In order to store a character in an array, sufficient memory
has to be "allocated" for it, but while reading we do not
know beforehand the size of the file (or the total length of
the sequence), and therefore increase the allocated aray
size prospectively once the previous allocation is filled.
This operaion is called `realloc' and frequently involves
the tedious copying of the entire array onto a new location
in memory, taking a time in proportion to the number
elemennts so far allocated.

The question is to develop an optimal allcation strategy for
a given distribution of file sizes. The fasted solution is
to allocate a gigantic array beforehand, but it is a
terrible waste of memory. The slowet solution is to
reallcoate for each single character read it, but is a
terrible waste of CPU time. As I understand the problem, a
strategy is needed that manifests some compromise between
the extremes.

> Looking at original, absent posts is something I've done
> dozens of times over the years. Never a problem, except
> fora time or two with posts from the 1990s. I've used
> GigaNews since my regular ISP stopped providing Usenet
> access, maybe 15 years ago.

Just in case, there are many totally free Usenet servers,
e.g.:
http://www.eternal-september.org/
https://www.i2pn2.org/

and even a web interface:

https://www.novabbs.com

--
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Rich Ulrich
Newsgroups: comp.lang.c, sci.stat.math
Date: Sun, 21 Jul 2024 23:40 UTC
References: 1 2 3 4 5 6 7 8 9 10
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 21 Jul 2024 23:40:15 +0000
From: rich.ulrich@comcast.net (Rich Ulrich)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
Date: Sun, 21 Jul 2024 19:40:16 -0400
Message-ID: <ug6r9j5caqlcasn784p8h63b8s1mhf5j26@4ax.com>
References: <v4ojs8$gvji$1@dont-email.me> <875xu8vsen.fsf@bsb.me.uk> <v4ovqf$j5hq$1@dont-email.me> <87zfrjvqp6.fsf@bsb.me.uk> <v4pb4v$lhgk$1@dont-email.me> <20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com> <s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com> <87le2kwf9z.fsf@nosuchdomain.example.com> <qa788jp18m80t3ltd29aaokhmp0l4sop40@4ax.com> <20240708200121.ec07d0338a336b56cc7387a1@g{oogle}mail.com>
User-Agent: ForteAgent/8.00.32.1272
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 32
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-FLLYDTcbB2ossaHzx/DSNppo+mjFHEO617hlv1FAEmTtNF3mGrjAn9byK5EvaE3n42bQxuXf+AA55CE!9hw2h3T/GwqU1nP2TRJD3R+p8D6D2jyoj9TiHzCUCnMM0xWjGd30E67aQIK5LgzpPKnyTLM=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
View all headers

On Mon, 8 Jul 2024 20:01:21 +0300, Anton Shepelev
<anton.txt@g{oogle}mail.com> wrote:

>Rich Ulrich:
>
>> Thanks, so it looks like a failure by GigaNews to retrieve
>> the recent posts.
>>
>> I did see a bunch of cross-posted followups. I don't know
>> C, and I thought there could be more context.

<snip. Thanks for the details.>

Okay, today I discovered that there was no failure by Giganews
or by Forte Agent -- Instead, there was BEHAVIOR by Agent
that I was not aware of.

Today, was looking at All Desks (Agent terminology) to see what
was in Sent, and I noticed there were messages in Inbox -- Those
were the messages that I thought Agent had failed to retrieve.
(Nice discussion there.)

I guess - every other time I've clicked on Message-ID, the old
message was in the group where I was reading and the old one
showed up where I was reading. I've read the Agent group for
ages, and I don't remember this feature ever being mentioned.

Live and learn.

--
Rich Ulrich

Subject: Re: realloc() - frequency, conditions, or experiences about relocation?
From: Anton Shepelev
Newsgroups: comp.lang.c, sci.stat.math
Organization: A noiseless patient Spider
Date: Tue, 23 Jul 2024 13:47 UTC
References: 1 2 3 4 5 6 7 8 9 10 11
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: anton.txt@g{oogle}mail.com (Anton Shepelev)
Newsgroups: comp.lang.c,sci.stat.math
Subject: Re: realloc() - frequency, conditions, or experiences about
relocation?
Date: Tue, 23 Jul 2024 16:47:39 +0300
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <20240723164739.d60ba6e9e8b850adf3887846@g{oogle}mail.com>
References: <v4ojs8$gvji$1@dont-email.me>
<875xu8vsen.fsf@bsb.me.uk>
<v4ovqf$j5hq$1@dont-email.me>
<87zfrjvqp6.fsf@bsb.me.uk>
<v4pb4v$lhgk$1@dont-email.me>
<20240617180249.96dfaafa89392827aa162434@g{oogle}mail.com>
<s1178jp7fjh4rgtsafa78dp6j05ejidau2@4ax.com>
<87le2kwf9z.fsf@nosuchdomain.example.com>
<qa788jp18m80t3ltd29aaokhmp0l4sop40@4ax.com>
<20240708200121.ec07d0338a336b56cc7387a1@g{oogle}mail.com>
<ug6r9j5caqlcasn784p8h63b8s1mhf5j26@4ax.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 23 Jul 2024 15:47:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="7fb650ba776c0c58c8083f478e356d96";
logging-data="1298663"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18nS02pfU0lW0JOgz8RDPzUtc+wjLrvYN8="
Cancel-Lock: sha1:wbHoIUtxA88cK40I2Ahv/JKl7tg=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
View all headers

Rich Ulrich:

> Today, was looking at All Desks (Agent terminology) to see
> what was in Sent, and I noticed there were messages in
> Inbox -- Those were the messages that I thought Agent had
> failed to retrieve. (Nice discussion there.)

Looking forward to your take on the problem. Mine is rather
simplisitc, but can be easily tested with several
distributions. This is like extrapolation: we know the
optimal solution for the given distribution (exponential)
and want to devise a general method to get the optimal
solution for any given distribution.

Malcolm, if you are still interested, can you provide a test
program that measures some statiscits for various allocation
strategies on various distributions, inclusing the
exponential?

--
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments

Pages:1234

rocksolid light 0.9.8
clearnet tor