From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: noverlay branch Date: Wed, 12 Oct 2022 23:59:25 -0400 Message-ID: References: <87sfjzefvv.fsf@rfc20.org> <875ygt6gbj.fsf@rfc20.org> <87edvf4p08.fsf@rfc20.org> <87r0zffs27.fsf@rfc20.org> <875ygpvtf0.fsf@rfc20.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37853"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Matt Armstrong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 13 06:01:57 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oipPx-0009bm-6P for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Oct 2022 06:01:57 +0200 Original-Received: from localhost ([::1]:60538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oipPv-0001BW-G4 for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Oct 2022 00:01:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oipNc-000877-Bt for emacs-devel@gnu.org; Wed, 12 Oct 2022 23:59:32 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:41478) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oipNZ-0007Lf-F0 for emacs-devel@gnu.org; Wed, 12 Oct 2022 23:59:30 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D6EB6443922; Wed, 12 Oct 2022 23:59:27 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 225B4443920; Wed, 12 Oct 2022 23:59:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1665633566; bh=DaMKb80CSs85qg5qEdPduOEa16Lddu9s3il2ab+Q0w0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VOcr4c8tNsGYpklrZLaqgDCHFd7rjDT2Tx8gaqdXQ62zXhXww+hCvAkGd0W/LyoSr 5pE0ZxmDkxjs9OzV7T25JHWWTykOItnfMgtkBWbBM/4mCA2/GCytYDMyysGfgGx+7F ezMT50dpZRuFpd206xqA1siu4d+eDfQmjT+rkrR0CHdKR11uPO8x3GWCNi3viOoGbU iK+NR0Wz+mlBZVaQUu0PePf1Bdao9MqbunBu4p/2Y4DJ0YCXp08HvzNhjEHXAKLCcr O++flX6L+RXgztW0K7w1fos6OTLY20m+iq9MLFQC30WZf721UK5djOD0HdFiqf1qwD 2Z35VkR/hcKNA== Original-Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E22CC12054C; Wed, 12 Oct 2022 23:59:25 -0400 (EDT) In-Reply-To: <875ygpvtf0.fsf@rfc20.org> (Matt Armstrong's message of "Wed, 12 Oct 2022 10:33:07 -0700") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297650 Archived-At: > Thanks Stefan, FWIW I don't see the merges on feature/noverlay yet. > Have you pushed? Hmm... I think so, yes. `git log` tells me: commit 65a7b5a802a15daa6274403fef822ec3c9b95469 (HEAD -> noverlay, origin/feature/noverlay) Author: Matt Armstrong Date: Tue Oct 11 20:19:16 2022 -0700 ; * src/itree.c (check_subtree): fix logical error in eassert commit fda8723be640593a662d7ff9d4900b7f9e56423e Author: Matt Armstrong Date: Tue Oct 11 20:32:08 2022 -0700 ; * src/itree.c (check_tree): assert that the tree root is black commit 034d50415858b18b032b116804bfefc1be421bb3 Author: Matt Armstrong Date: Tue Oct 11 11:41:47 2022 -0700 ; * .clang-format: Add ITREE_FOREACH. commit 12836db6e4e09378d41301b3d4e1fcff58132d3a Author: Stefan Monnier Date: Tue Oct 11 11:17:44 2022 -0400 itree.c (check_tree): Simplify * src/itree.c (struct check_subtree_result): Remove `complete`. (check_subtree): Remove `max_depth` arg (and adjust callers). Use 0 as black-depth of empty tree. Remove redundant `node->parent` check (already performed by the caller). (check_tree): Replace with `check_tree_common` (update all callers). Check the root's `parent` field. (check_tree_no_rb): Delete function, inlined in its sole caller. (interval_tree_remove): Add call to `check_tree` (without RB checks) before `interval_tree_remove_fix`. Move update of `size` field accordingly. commit da0387f0fe79f577fae6d5453c758f600e1ae495 Author: Matt Armstrong Date: Mon Oct 10 10:45:05 2022 -0700 Stop reading and writing the itree_null.parent field entirely. With this change all fields in the itree_null sentinel are read only. This makes accessing itree_null thread safe in an obvious way. Because it took two commits from two peole to get this right, I think we can call this design fragile and difficult to reason about. Another benefit of this commit is as preparation for removing sentinel node completely, and just using NULL. * src/itree.c (itree_null): Statically initialize itree_null.parent to NULL. It is never accessed. (null_is_sane): Assert parent == NULL. (interval_tree_remove_fix): Remove unecessary assignments to parent from node->parent. These were the last places itree_null.parent were read. (interval_tree_remove): Avoid an assignment to itree_null.parent through min->right->parent. (interval_tree_transplant): Avoid an assignment to itree_null.parent through source->parent. [...] -- Stefan