From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Gerd_M=c3=b6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: noverlay branch Date: Thu, 29 Sep 2022 16:54:14 +0200 Message-ID: <1468ca31-1703-82a1-0c8c-be2c5b5674a7@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9300"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Cc: emacs-devel@gnu.org, matt@rfc20.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 29 19:12:23 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 1odx5D-0002Im-Lx for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Sep 2022 19:12:23 +0200 Original-Received: from localhost ([::1]:39584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odx5C-0004Yy-2b for ged-emacs-devel@m.gmane-mx.org; Thu, 29 Sep 2022 13:12:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oduvb-0003nd-FI for emacs-devel@gnu.org; Thu, 29 Sep 2022 10:54:20 -0400 Original-Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:39927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oduvZ-0000ts-VV for emacs-devel@gnu.org; Thu, 29 Sep 2022 10:54:19 -0400 Original-Received: by mail-ej1-x62b.google.com with SMTP id b2so3336658eja.6 for ; Thu, 29 Sep 2022 07:54:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id:from:to:cc :subject:date; bh=eaCfHP2t6G4OwwNhxuYUTokg92d/o5tILD/WiRrZAZs=; b=jlG6+mA4g7xCCAPqmoHMtPBv3YeyZGw5ACMvc9wPcdVN67zFTWesQh61vM2eKx8w2W MLRQzsXzgFApDUsVDvs44zke79S52QKm9AO5d7PI0UGHEHmcl98eUX33I8zieFZHfn+o dA+oKzM2h0wTifsvo84BRcpRL545+TH+i68DKVW+2xbi8yEgdIaP5kBi5n5J7kIjYbmG +k8OK4yRilLJNCf3qNNIWNUUIl11g5l7a0jLGsNPnVPnKXRIWbi/XhRDS/15v2lQ99FW DbVuKNfPHZhJGQCCD9lFX6CP4t6Zubzk8hnrYl2kUxJaO6wnC9ZV/UOKPjEXq0my9acT wtFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=eaCfHP2t6G4OwwNhxuYUTokg92d/o5tILD/WiRrZAZs=; b=8BCS6TgkX7a7qpZYfJ76gxCYK7lnnQKN27/3/XvBpSkcHQtzKLAWefRqqLcGw3C3y4 mNK/JOo64x7YHeZEJC6mx24cT+vpzOIQRwKswPnXKcWnJB4nnmrJNOsRTsZ0Utk4aqAf SYi5OZWOh5JYuXqHvPu/3cEb82A6v051yNRV6guSoNPx7eI0dEIKLNsZebFmkrdwc63s l5gjxP0ZX/9do4akdex6vAyfWMjA437aExpBtYMlkmp+CrGfEbHl1QzHVPkbtu8l9wSN iGAevY8SgFUnyBb7RFuw+sMMd8kj+wOfQfecaGpf9npKf4OBpPf/8z5NdlbP4jCbc177 YRpA== X-Gm-Message-State: ACrzQf3XPtPbsrX5WcVjFGOrvfxBd/QWXI9FwQIWbgvSWLra3rB67/Ea dv4v5lpc9kukLYIUkjGidL0= X-Google-Smtp-Source: AMsMyM7N53RQ88QMJWtR+1p+oGfIv2kmKWkJkkuqSNvd1egB5dDZpO5nFhVUqtdVHFbH6fBJlu8/eA== X-Received: by 2002:a17:907:72c3:b0:783:a9ea:4ad7 with SMTP id du3-20020a17090772c300b00783a9ea4ad7mr2933518ejc.533.1664463256042; Thu, 29 Sep 2022 07:54:16 -0700 (PDT) Original-Received: from [192.168.178.21] (pd9e36935.dip0.t-ipconnect.de. [217.227.105.53]) by smtp.gmail.com with ESMTPSA id qc27-20020a170906d8bb00b0073c0b87ba34sm4066722ejb.198.2022.09.29.07.54.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 07:54:15 -0700 (PDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=gerd.moellmann@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -61 X-Spam_score: -6.2 X-Spam_bar: ------ X-Spam_report: (-6.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-4.099, RCVD_IN_DNSWL_NONE=-0.0001, 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:296471 Archived-At: > What I'm less clear about is the use of the `null` sentinel node. > It seems that this node is sometimes modified (e.g. its color changed > from black to red or vice versa, and maybe also its `parent` field), > even though it's pointed to from lots of different nodes, so any help > documenting the way it works (or why the value in those fields doesn't > matter) would be welcome. Maybe I can say something because I used a similar trick in alloc.c. The gist of that was to make searching more elegant, and faster: static struct mem_node * mem_find (void *start) { struct mem_node *p; ... /* Make the search always successful to speed up the loop below. */ mem_z.start = start; mem_z.end = (char *) start + 1; p = mem_root; while (start < p->start || start >= p->end) p = start < p->start ? p->left : p->right; return p; } If that's done for the same reason in itree.c, I don't know. A hint that it is not, might be that each tree has a separated null node...