From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: maphash Date: Sat, 28 Sep 2024 11:42:49 +0300 Message-ID: <86wmiw6ueu.fsf@gnu.org> References: <875xr3h5g9.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28239"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mattias.engdegard@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 28 10:43:42 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 1suT3F-0007Aw-2F for ged-emacs-devel@m.gmane-mx.org; Sat, 28 Sep 2024 10:43:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suT2W-0004cZ-RE; Sat, 28 Sep 2024 04:42:56 -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 1suT2V-0004b5-HC for emacs-devel@gnu.org; Sat, 28 Sep 2024 04:42:55 -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 1suT2V-0000DK-1l; Sat, 28 Sep 2024 04:42:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=8xWGOgHfUa17spxcoFiL+CMWtKE8gWatPYy5ZQgR1Zc=; b=WXEroH3u4yh3P6Gg0I2T XNK2jJ+bFhZZgEZKvJ5G94eYKyXeeTh6AOilmfN5RGM9GOFzJ85BlmY5CNQAC6h1wQOomQrMG/87R cQLuCow90R54jxnASiokfz/dXoyOqCivcNnGU4xvNsOTgXlAFwAwXmRBdNpVx9pC3UOXIwiGRYva1 NaEQda5F9VikBKHlQBNC8Sl04Hk7bQHdILNJZI2n5R2PoAo2otj/E58FiY3WJiWCzROCzvBXCa7bH ZYXftPTFVY7PW8Q/BlKMqPwWnq5LE5JOSncufpElMcHuVWysTo8sMcBFlWgRkSoImGYWrW1kQ5hbu /hC4gHqTgT5nag==; In-Reply-To: (message from Andrea Corallo on Wed, 11 Sep 2024 18:45:16 -0400) 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:324156 Archived-At: Ping! Andrea, did you have time to look at this? > From: Andrea Corallo > Cc: Helmut Eller , emacs-devel@gnu.org > Date: Wed, 11 Sep 2024 18:45:16 -0400 > > Mattias EngdegÄrd 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 implementation 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 > >