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: weak hash tables Date: Sun, 07 Jul 2024 20:29:00 +0200 Message-ID: References: <8734olzlws.fsf@gmail.com> <867cdx32e3.fsf@gnu.org> <864j912t0s.fsf@gnu.org> <86zfqt1cxa.fsf@gnu.org> <86y16d1aik.fsf@gnu.org> <86tth119bs.fsf@gnu.org> <86jzhx148w.fsf@gnu.org> <86h6d112qc.fsf@gnu.org> 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="28483"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pipcet@protonmail.com, eller.helmut@gmail.com, yantar92@posteo.net, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 07 20:29:51 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 1sQWdy-0007ED-Go for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jul 2024 20:29:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQWdJ-0007ZI-LI; Sun, 07 Jul 2024 14:29:09 -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 1sQWdI-0007Y1-1E for emacs-devel@gnu.org; Sun, 07 Jul 2024 14:29:08 -0400 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQWdG-00047K-95; Sun, 07 Jul 2024 14:29:07 -0400 Original-Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-58b447c519eso3828765a12.3; Sun, 07 Jul 2024 11:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720376942; x=1720981742; darn=gnu.org; h=content-transfer-encoding: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=S7kHiB4vvmvOoxnHtHTo58/jYuArVIS71i7INssQfM8=; b=SuYEyiK7R1GxR4JTuHiJEDQyL5QeZzvzPiwbfxnytCGmDtdRJTqKVg0D0JKhZ2EGse xv7ShVIipcOn6yjQTcD0GxMsWF6hpgfkI6hrCu5Z+PXJout2VADYCwcHzS/yE7X3ydzG 3+4fFj5Gp7TPNxMnCV5X6/y5sWIVHZNTfS0qnSEmKwEXnxaGnBGvLbK/USKky3LanU83 YHwccnYNOyWfsS2UA/oAMcpqPU6Ddz8ToFbjsyeQZ+UabZa5jmd54d4+I75r4Da9+9J2 LLdxin5SZv4aS11OAp3LlJmzIM+o2eOPaQ2KmMl8khb5O1fZHZVcmQXrQGiWGp8y92MD PytQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720376942; x=1720981742; h=content-transfer-encoding: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=S7kHiB4vvmvOoxnHtHTo58/jYuArVIS71i7INssQfM8=; b=rHw1PY4c0mJ/AHPZ8MnqYBnP8dbrP5r04sV/R4g6tDQlBI5tTn03EtzaYilGC8LVjU NSSfg6sesbkI2GFLBsWezkEnLxWPks+QVmlXYaYsUQ7U2m04MQ7fFmAlRM/Joy/pEZwG kaHo9Ncse/bQsTC701hrVyXfW7YJoDkl01274Wis1ClaKSkSfUad497Zt2Rg8EQSrpQZ GozFf+Kre5LkEa949z/r+GbNfnHSJP25KrDDi8NeLDwq+kURtmBNctVD/EcTP9l9L4ie khjk3gVl93YfGwn6GPr5eGV3KqXHMhsC+gglUD4Uf3TGyy5Tiq2mnAqBT1KqdlHqzUxd NC7w== X-Forwarded-Encrypted: i=1; AJvYcCXTBF4PI1crwS2lskATnB3Yng5aCxnM/TAe1LeZUgtQyrCUtcpD10IAjp8hakQdJlgH7FlNbxStD/0whNW2EyZrZh7h X-Gm-Message-State: AOJu0YyChg70sAQyAWYVTlPevinfphw2FoBkf+LxlWYTg2itcUgOINgf j7Zk+RtKexyzoaAFEdX0szA1P1K7EwzC8GQheXJLLwGUCltOpIVgrSh4eA== X-Google-Smtp-Source: AGHT+IEAnqvxUL31cBWorRve4mFOhgCZ789cC98gqjAHjr4vU53ka7tu4vTGYvQ9PyzJaw8cV1tbvA== X-Received: by 2002:a17:906:b259:b0:a77:e2e3:355f with SMTP id a640c23a62f3a-a77e2e34b1cmr258825366b.41.1720376942215; Sun, 07 Jul 2024 11:29:02 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a778.dip0.t-ipconnect.de. [79.227.167.120]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a72aaf18950sm858137166b.20.2024.07.07.11.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jul 2024 11:29:01 -0700 (PDT) In-Reply-To: <86h6d112qc.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 07 Jul 2024 21:22:35 +0300") Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:321515 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: pipcet@protonmail.com, eller.helmut@gmail.com, yantar92@posteo.net, >> emacs-devel@gnu.org >> Date: Sun, 07 Jul 2024 20:15:34 +0200 >>=20 >> Eli Zaretskii writes: >>=20 >> > I understand all that, but unchaining an interval involves the need to >> > modify the pointers of its adjacent nodes, and how can MPS do that >> > without understanding our data structures? >>=20 >> Can you please show me what code you mean?=20 > > This one: > > static void > sweep_intervals (void) > { > struct interval_block **iprev =3D &interval_block; > int lim =3D interval_block_index; > object_ct num_free =3D 0, num_used =3D 0; > > interval_free_list =3D 0; > > for (struct interval_block *iblk; (iblk =3D *iprev); ) > { > int this_free =3D 0; > ASAN_UNPOISON_INTERVAL_BLOCK (iblk); > for (int i =3D 0; i < lim; i++) > { > if (!iblk->intervals[i].gcmarkbit) > { > set_interval_parent (&iblk->intervals[i], interval_free_list); > interval_free_list =3D &iblk->intervals[i]; > ASAN_POISON_INTERVAL (&iblk->intervals[i]); > this_free++; > } > else > { > num_used++; > iblk->intervals[i].gcmarkbit =3D 0; > } > } > lim =3D INTERVAL_BLOCK_SIZE; > /* If this block contains only free intervals and we have already > seen more than two blocks worth of free intervals then > deallocate this block. */ > if (this_free =3D=3D INTERVAL_BLOCK_SIZE && num_free > INTERVAL_BLOCK_SI= ZE) > { > *iprev =3D iblk->next; > /* Unhook from the free list. */ > ASAN_UNPOISON_INTERVAL (&iblk->intervals[0]); > interval_free_list =3D INTERVAL_PARENT (&iblk->intervals[0]); > lisp_free (iblk); > } > else > { > num_free +=3D this_free; > iprev =3D &iblk->next; > } > } Ah! There are no interval_blocks, no interval_free_list nothing of that in MPS.