From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#716: Bug in buffer-swap-text Date: Tue, 23 Dec 2008 21:41:22 -0500 Message-ID: References: <4950DD60.4080202@gnu.org> <4950FAF6.808@f2s.com> <49510053.6020805@f2s.com> <1230081428.49518d94a3a08@webmail.freedom2surf.net> Reply-To: Stefan Monnier , 716@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230087981 16388 80.91.229.12 (24 Dec 2008 03:06:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 24 Dec 2008 03:06:21 +0000 (UTC) Cc: Magnus Henoch , 716@emacsbugs.donarmstrong.com To: jasonr@f2s.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 24 04:07:27 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LFK5f-00010B-I7 for geb-bug-gnu-emacs@m.gmane.org; Wed, 24 Dec 2008 04:07:19 +0100 Original-Received: from localhost ([127.0.0.1]:40990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFK4S-0002tb-M5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Dec 2008 22:06:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LFK4O-0002tT-Pq for bug-gnu-emacs@gnu.org; Tue, 23 Dec 2008 22:06:00 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LFK4N-0002tH-CK for bug-gnu-emacs@gnu.org; Tue, 23 Dec 2008 22:06:00 -0500 Original-Received: from [199.232.76.173] (port=41662 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LFK4N-0002tE-7q for bug-gnu-emacs@gnu.org; Tue, 23 Dec 2008 22:05:59 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47261) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LFK4M-0002x7-PS for bug-gnu-emacs@gnu.org; Tue, 23 Dec 2008 22:05:59 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBO33K3C003804; Tue, 23 Dec 2008 19:03:20 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mBO2o4Yl032228; Tue, 23 Dec 2008 18:50:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Wed, 24 Dec 2008 02:50:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 716 X-Emacs-PR-Package: emacs,w32 X-Emacs-PR-Keywords: Original-Received: via spool by 716-submit@emacsbugs.donarmstrong.com id=B716.123008649230395 (code B ref 716); Wed, 24 Dec 2008 02:50:03 +0000 Original-Received: (at 716) by emacsbugs.donarmstrong.com; 24 Dec 2008 02:41:32 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mBO2fSRj030361 for <716@emacsbugs.donarmstrong.com>; Tue, 23 Dec 2008 18:41:30 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsgEAEYwUUlFxKfZ/2dsb2JhbACBa7xLWJFjhkKBYg X-IronPort-AV: E=Sophos;i="4.36,274,1228107600"; d="scan'208";a="31438500" Original-Received: from 69-196-167-217.dsl.teksavvy.com (HELO pastel.home) ([69.196.167.217]) by ironport2-out.teksavvy.com with ESMTP; 23 Dec 2008 21:41:22 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 95BAD8780; Tue, 23 Dec 2008 21:41:22 -0500 (EST) In-Reply-To: <1230081428.49518d94a3a08@webmail.freedom2surf.net> (jasonr@f2s.com's message of "Wed, 24 Dec 2008 01:17:08 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 23 Dec 2008 22:06:00 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:23460 Archived-At: >> Your analysis sounds right, thank you. I'd suggest to use another >> r_alloc primitve, something like r_alloc_reset_variable, so you could do > I've adapted your suggestion so it does not remove the consistency check in > find_bloc (instead it does a non-checking find inline): Thanks. After your email, I thought we could just change r_alloc_reset_variable to take 2 arguments: the old ptr and the new ptr. This way, you get more consistency checking. BTW, if the double check (p->variable == ptr && p->data == *ptr) is there for consistency, it would be good to add a comment about it. Better yet: make it a real consistency check, along the lines of assert (*p->variable == p->data); so it's not just checked for `ptr', but for all blocs visited in the loop. Stefan