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: MPS: dangling markers Date: Mon, 01 Jul 2024 21:43:41 +0200 Message-ID: References: <87v81u85hv.fsf@localhost> <7YYJyDLCuZhtkTAT_ry6S14y4KoAJtsV_2Ui8Dsy37afuN1zucoO6VPh6YAvKQCs-0OUP3-rTFogtJBLrv2wiZ9rq6lacV-p_M1qsSSgKOk=@protonmail.com> <1osQTI7Swoo72EJbCzzi4zqVXuC5hSlYEXwLtnal8_pyYL7oRCNSJg20XgBRjffZ344Wj7lwFDc9JSMsQ-3su6uXQ8hYSfYleRn-4GRrykI=@protonmail.com> <86a5j1djzy.fsf@gnu.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="33285"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Pip Cet , yantar92@posteo.net, monnier@iro.umontreal.ca, emacs-devel@gnu.org, eller.helmut@gmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 01 21:44:39 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 1sOMx4-0008Or-Bp for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jul 2024 21:44:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOMwH-0002UD-2C; Mon, 01 Jul 2024 15:43:49 -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 1sOMwE-0002Tz-Qq for emacs-devel@gnu.org; Mon, 01 Jul 2024 15:43:46 -0400 Original-Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOMwD-0002tV-5x; Mon, 01 Jul 2024 15:43:46 -0400 Original-Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-57d1d614049so941124a12.1; Mon, 01 Jul 2024 12:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719863023; x=1720467823; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=OmIuv9GBf6HEsctGSauY265SbKqnnCNR2c4HySGf+wQ=; b=EcIZ//TSk/u2PsMSQiN3r73gvZlHZyb1ZVM55E5xLaZLJWbvOht5NDPX5Z9ImAoz9S q2RfO09wmw8vTq/masdj+t+NbAb8VHXQpCGUaoL6EluU7AvEmFLUvTIkNzMz1XHCuV0V nmTj5tDx3s7PzJBI6wW/4mwV6jyeXg4OYOhzdExCoCthgClrNGO6qq7oDmk/XktdUts+ GhLJnmT7X4A49ROZCw9MZYW3p9Zkh3kbCDSQ7FSNj+rz6awOeVxV0e8WMgLRzBvidNil ylGDa2ihOdUwXJHzD0X9Q0N+kyZIFDxO1UcymwWjV8c9jyDeSrvC4Vsy2zr917Hd5rRx ltoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863023; x=1720467823; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OmIuv9GBf6HEsctGSauY265SbKqnnCNR2c4HySGf+wQ=; b=LTKABgLWgDQx982N8m4V/vAs91oD/DlTLPpzDM2ukq8rP0+8mOlN8ZpxZoIsY9oSXF 7SYhPnHgkSOz2ehCoCQJPAOOMWLt3R8fVwPYnpnncfdkTAagzquZnXEufNORA6O1fB42 hSey96c3diSzKTZ3+MHbJH2KSyUiYVJsGqpmrjSiIuEhfA9cairqRUiNTrJu7oPv/Sgv XBExcYNndwGJeFutQQqkxIUKDFMnsNSqP3+CFqV1CI7NYm6dlKa6QFNSbTg8mwFFeBvn PbAnpxxzUIwDlXjLtKh3Ckxt6V6nxbDbX/T5gAamMReCVsI77h9t/3UPmITZHVyaD/ux XcjA== X-Forwarded-Encrypted: i=1; AJvYcCUOs02KTdz0srPgeGjVyPmqcaMawxLGrdBLepGJDnM/KEwd/NDE1hIQHZNGUAtWSQ1Dd4pni0Sg4PIVDAJZTnqm7pmf X-Gm-Message-State: AOJu0YzRUjcwUqMwj6syzX+Joj2X0KmXiZkv8syOn1BewlzzYhxKNP8L eQ9wxV0HfiSHZxgoZkUSN1CdblGZbRQETnAx46ld1gU8GN4Xv1Fq X-Google-Smtp-Source: AGHT+IHwSbB1e++HOEKAfIqvgAMOTTx5tolNvmjYTW7xHakZyO8wOxcT546My05/LLx8CeSDWWw6Rw== X-Received: by 2002:a05:6402:510e:b0:579:e6ff:c61f with SMTP id 4fb4d7f45d1cf-5879f69c6afmr6280063a12.25.1719863022847; Mon, 01 Jul 2024 12:43:42 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a7fc.dip0.t-ipconnect.de. [79.227.167.252]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-58614d5049csm4715127a12.63.2024.07.01.12.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:43:42 -0700 (PDT) In-Reply-To: <86a5j1djzy.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Jul 2024 21:50:41 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321066 Archived-At: Eli Zaretskii writes: > This code: > > static void > maybe_resize_weak_hash_table (struct Lisp_Weak_Hash_Table *h) > { > if (XFIXNUM (h->strong->next_free) < 0) > { > ptrdiff_t old_size = WEAK_HASH_TABLE_SIZE (h); > ptrdiff_t min_size = 6; > ptrdiff_t base_size = min (max (old_size, min_size), PTRDIFF_MAX / 2); > /* Grow aggressively at small sizes, then just double. */ > ptrdiff_t new_size = > old_size == 0 > ? min_size > : (base_size <= 64 ? base_size * 4 : base_size * 2); > > is unsafe, since AFAIU it could produce new_size = PTRDIFF_MAX, and > that cannot fit in a fixnum, not even on a 64-bit system (although in > a 32-bit build this is much easier to reach). So this loop: I think the code is essientially the same as for the existing hash tables, which I assume works on 32 bits. Different is ptrdiff_t old_size = WEAK_HASH_TABLE_SIZE (h); so maybe WEAK_HASH_TABLE_SIZE gives a wrong value?