delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2026/02/27/19:53:08

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 61S0r7UV1892558
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 61S0r7UV1892558
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=kzUCgkPW
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB3C94BA23EE
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1772239983;
bh=r9CWPNdJhqf3ONOwWoNqDqnRSuyCN6bUo/TkvI05DJg=;
h=Date:To:Cc:In-Reply-To:References:Subject:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=kzUCgkPWD8/mXvZXinModWREsBy5osjwVMyFOnKbi6GBmzcIb5cEkMmYyajuwMkuJ
SONeUTlXYG3br8oMcBEWSHoNLxsnIN/aMCXm2nnMHZ1mRfq16Gbi0aWxRnULEkN1cP
TL0AJWYm1Z27GPGXDpo1eozuNk/GjIfOEGsVzHeI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD71C4BA23C8
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BD71C4BA23C8
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772239932; cv=none;
b=KS58GBxf3/lwNbagBrLnWnCEPlyUd0h3y00x4Uo3hMHMbL/Ag+6jG6QunP9fZqxhjOU2G9ipLdJD2LGJW1QefWWFS14o0EPohgX4cqeg0H2/z++p5FHwYWOELvCATxRkHwPbmunqG7U5m7ISQGePyRpamws3rlGMUMD7J5/kpqg=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1772239932; c=relaxed/simple;
bh=AZsg22T5MRP+LP9uC8gzclrqWZz3Rf1weVXo7qDPGXM=;
h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version;
b=oysSVPeBzBaLmxNlVoXfRDC36lLZLf744kRDl3px0CRp4uRqzOiBZm5hJ1pk5ACoMiGWCIv6PK7lr2jGwQgyrH/xZzH9NpyosKik5Fso7lqvzl/0icDKrYd6hIqPrnoY+Fvl7Ol2IgHfmUl7U/PDEy8KKsPiCCFVrDk3cUEuMlA=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD71C4BA23C8
Date: Fri, 27 Feb 2026 16:52:06 -0800 (PST)
To: matthew patton <pattonme AT yahoo DOT com>, Eliot Moss <moss AT cs DOT umass DOT edu>,
Dimitry Andric <dimitry AT unified-streaming DOT com>
Cc: KENNON J CONRAD via Cygwin <cygwin AT cygwin DOT com>
Message-ID: <44247232.1557085.1772239926319@connect.xfinity.com>
In-Reply-To: <1267026412.2290036.1772230634764@mail.yahoo.com>
References: <547312365 DOT 1464244 DOT 1771958282029 AT connect DOT xfinity DOT com>
<aZ7PrbisVR1R4A7v AT dimstar DOT local DOT net>
<1670201592 DOT 1489273 DOT 1772043520008 AT connect DOT xfinity DOT com>
<e91d8b5b-2690-4271-aa74-e6226440e33d AT SystematicSW DOT ab DOT ca>
<1044918836 DOT 1507810 DOT 1772086967212 AT connect DOT xfinity DOT com>
<1579472684 DOT 1508349 DOT 1772092747339 AT connect DOT xfinity DOT com>
<aaABFf5iEowV1l7I AT xps13>
<1148572549 DOT 1808180 DOT 1772097444036 AT mail DOT yahoo DOT com>
<1901597260 DOT 1508573 DOT 1772100378936 AT connect DOT xfinity DOT com>
<0C965DD0-856E-41FF-B5A4-15E472292A32 AT unified-streaming DOT com>
<483908609 DOT 1508714 DOT 1772103775739 AT connect DOT xfinity DOT com>
<2346fd41-2500-0db6-5849-6788174b5a1d AT cs DOT umass DOT edu>
<1462848037 DOT 1521935 DOT 1772136952077 AT connect DOT xfinity DOT com>
<399745a1-429a-ebb4-0f67-c32f6282caa6 AT cs DOT umass DOT edu>
<1093316506 DOT 1533154 DOT 1772157883568 AT connect DOT xfinity DOT com>
<3e0de899-a7dd-8fea-7743-10e6b05cc6b6 AT cs DOT umass DOT edu>
<1990836634 DOT 1545853 DOT 1772216419837 AT connect DOT xfinity DOT com>
<1267026412 DOT 2290036 DOT 1772230634764 AT mail DOT yahoo DOT com>
Subject: Re: Memmove causing program crashes, giving SIGTRAP in GDB(?)
MIME-Version: 1.0
X-Priority: 3
Importance: Normal
X-Mailer: Open-Xchange Mailer v7.10.6-Rev83
X-Originating-IP: ::ffff:50.47.202.14
X-Originating-Port: 39118
X-Originating-Client: open-xchange-appsuite
X-CMAE-Envelope: MS4xfOhVi/xty7NXlbPodcoJ4ri9gaqQqZwxHKHeCny2Rs5+F5Cfy6Ry+R42qxgE/205kWxI9x4Sf2AD3A2u1bvxNRryBHAitVQlLp0v7AOVGYHA0QPUREZ8
Xn1C339+a0Cw8cdUDT4cd4l7hyqL/dtZbWHfIFaPbU1LsSqq9Oza9O3+7cmNFihlTaE/mExilL6IjxooRF7A/8bembbpV8qVOtW7qYXEVmj5mkElqpoJSZ64
LLpqjYXJcgBqRoc9vHRAH0xFKpLQCObVyAcOPGxJZlQgN9+HtSx0lj+iZeImEFIszTDzrg1d3wTmkHJJWVxVVw==
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: KENNON J CONRAD via Cygwin <cygwin AT cygwin DOT com>
Reply-To: KENNON J CONRAD <kennonconrad AT comcast DOT net>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

That is not going to happen for two reasons.
1.  It would unnecessarily consume more memory.  This test case (Large Text Compression Benchmark by Matt Mahoney) already
uses about 16 GB of memory to run optimally and using more memory may cause (additional?) paging and thrashing on my test machine
that has 16 GB of RAM.
2.  It would likely be slower to execute.  The entire array would need to be copied with up to 3 memcpy's every time the array
is modified, and either copied back with another memcpy or the code would need to manage two start of array pointers.

Efficient code is not janky hanky panky.  The latest release of GLZA uses 16 lines of C code that can be easily reduced to 10 lines
since alignment is apparently not an issue, or slighly more if the "stash and move" method is used like the memmove function does.
Brute forcing it with 3 - 4 memcpy's plus an extra memory allocation with an additional pointer that needs to be passed to and
managed by the thread would likely require more code than that.

> On 02/27/2026 2:17 PM PST matthew patton <pattonme AT yahoo DOT com> wrote:
> 
>  
> do what I suggested in my earlier post.
> 2 copies of the datastructure A and B. you only need to malloc them once at the beginning and also since only one thread manipulates the data, right?
> 
> When you're in a situation where you need to 'slide' the data to the right, just memcpy from the current to the new and offset by the sizeof_int16_t). No janky hanky panky and can't possibly have CPU or OS side-effects.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019