From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: maphash Date: Wed, 11 Sep 2024 18:45:16 -0400 Message-ID: References: <875xr3h5g9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11597"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , emacs-devel@gnu.org To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Sep 12 00:45:50 2024 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 1soW5u-0002sy-Hb for ged-emacs-devel@m.gmane-mx.org; Thu, 12 Sep 2024 00:45:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1soW5b-0005gb-Ma; Wed, 11 Sep 2024 18:45:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soW5O-0005fq-FN for emacs-devel@gnu.org; Wed, 11 Sep 2024 18:45:19 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1soW5N-00081H-Rb; Wed, 11 Sep 2024 18:45:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=m7VXkr1NN5b+N4oJclxHTr2UAZCXntxYXFO9KxapY7M=; b=N2ZFuXH7jFGs4uKU08Uo IJJ6CUWvK0pB8bbjq2mIxhxYFar/oYXXxEQD6/poNFCM8n0/7NJKuWECtoSK2juDaKxK0kiflDWR/ JDjry8G6RNYGGRIDyOARRlq4/IncpB/Og8ofDdGDflFeOuwKkGy4VJ6A4pSvDWBO71wJGj1zYSD37 OTphDaqrAZs/ccACcz+U2gj9NHErO1qtkEtvIhwWY5063+owALAzghIAzW65h0w6LSHomDFsz2M9r t+Pt2NoWBs3jFNVGnGIxqsjsI8D5pAvCt9DSAhDslsxq70KBcZi1OW4k4xYyvYD5tsb7cblZLD6ZU WEDXeuGJ4hB/rA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1soW5N-0000dN-AN; Wed, 11 Sep 2024 18:45:17 -0400 In-Reply-To: ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Wed, 11 Sep 2024 16:23:18 +0200") 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323550 Archived-At: Mattias Engdeg=C3=A5rd writes: > 10 sep. 2024 kl. 17.52 skrev Helmut Eller : > >> The documentation states that puthash and remhash are only "allowed" to >> use the current key while a maphash is in progress. (Interestingly, it >> says nothing about gethash.) > > That is correct. The purpose of these rules is to avoid us being shackled= to a specific behaviour if a user breaks them; we don't want any more impl= ementation restrictions than necessary. > > We still protect Lisp abstractions so the user shouldn't fear > segfaults, but there are no promises when it comes to the iteration > order, whether iteration will encounter added elements, the same > element twice or some none at all, etc. > >> However, the code in comp.el uses puthash with other keys. E.g >> comp--add-cond-cstrs-simple iterates over a hashtable of basic blocks >> and while the iteration is in progress, it calls >> comp--add-cond-cstrs-target-block which puts new basic blocks into the >> hashtable. > > This sounds like a bug in nativecomp then, even if it happens not to have= any bad consequences right now. Ops! Will look at thanks Andrea