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@delorie.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@cygwin.com
Delivered-To: cygwin@cygwin.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@yahoo.com>, Eliot Moss <moss@cs.umass.edu>,
        Dimitry Andric <dimitry@unified-streaming.com>
Cc: KENNON J CONRAD via Cygwin <cygwin@cygwin.com>
Message-ID: <44247232.1557085.1772239926319@connect.xfinity.com>
In-Reply-To: <1267026412.2290036.1772230634764@mail.yahoo.com>
References: <547312365.1464244.1771958282029@connect.xfinity.com>
 <aZ7PrbisVR1R4A7v@dimstar.local.net>
 <1670201592.1489273.1772043520008@connect.xfinity.com>
 <e91d8b5b-2690-4271-aa74-e6226440e33d@SystematicSW.ab.ca>
 <1044918836.1507810.1772086967212@connect.xfinity.com>
 <1579472684.1508349.1772092747339@connect.xfinity.com>
 <aaABFf5iEowV1l7I@xps13>
 <1148572549.1808180.1772097444036@mail.yahoo.com>
 <1901597260.1508573.1772100378936@connect.xfinity.com>
 <0C965DD0-856E-41FF-B5A4-15E472292A32@unified-streaming.com>
 <483908609.1508714.1772103775739@connect.xfinity.com>
 <2346fd41-2500-0db6-5849-6788174b5a1d@cs.umass.edu>
 <1462848037.1521935.1772136952077@connect.xfinity.com>
 <399745a1-429a-ebb4-0f67-c32f6282caa6@cs.umass.edu>
 <1093316506.1533154.1772157883568@connect.xfinity.com>
 <3e0de899-a7dd-8fea-7743-10e6b05cc6b6@cs.umass.edu>
 <1990836634.1545853.1772216419837@connect.xfinity.com>
 <1267026412.2290036.1772230634764@mail.yahoo.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@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: KENNON J CONRAD via Cygwin <cygwin@cygwin.com>
Reply-To: KENNON J CONRAD <kennonconrad@comcast.net>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.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@yahoo.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
