Path: nntp.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: John Ames Newsgroups: comp.os.linux.misc Subject: Re: VMS Date: Wed, 25 Jun 2025 09:44:18 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: <20250625094418.00007fd2@gmail.com> References: <87tt4i9nw5.fsf@eder.anydns.info> <102l0h9$fjtb$5@dont-email.me> <4_GdncCsf-Nqe8n1nZ2dnZfqnPSdnZ2d@giganews.com> <103392c$lpbg$5@dont-email.me> <1033o4a$1qj6$3@dont-email.me> <1033tv1$3aqu$3@dont-email.me> <1034pj8$a74s$1@dont-email.me> <20250625093213.00002ec2@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Wed, 25 Jun 2025 18:44:23 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d512b6635f3cd16b92286572adcaf1a4"; logging-data="3031622"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX193xIrBIeW2mmdKZdQqD0EDAQW7uk+QhUM=" Cancel-Lock: sha1:qtQW174pOZfwCidL9ZDUwr3Yo+Q= X-Newsreader: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) On Wed, 25 Jun 2025 09:32:13 -0700 John Ames wrote: > > Regardless, easy fix - always allocate at least one byte/word/ > > whatever more than you THINK you need. Minimal penalty - possibly > > BIG gains. > > That strikes me as a terrible strategy - allocating N elements extra > won't save you from overstepping into N+1 if and when you finally do (Additionally, it won't save you from whatever weird undefined behavior may result from reading an element N which isn't even part of the "true" range and may have uninitialized/invalid data.)