From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: dangling markers Date: Sun, 30 Jun 2024 20:15:36 +0000 Message-ID: References: <87v81u85hv.fsf@localhost> <7YYJyDLCuZhtkTAT_ry6S14y4KoAJtsV_2Ui8Dsy37afuN1zucoO6VPh6YAvKQCs-0OUP3-rTFogtJBLrv2wiZ9rq6lacV-p_M1qsSSgKOk=@protonmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_SWks5owKwq4drGdL38tuSA69EjYBFu22XTj169Sw" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32529"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org, eller.helmut@gmail.com To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 01 04:19:44 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 1sO6ds-0008Cv-E9 for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Jul 2024 04:19:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sO6dL-0004c5-NT; Sun, 30 Jun 2024 22:19:12 -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 1sO0xj-0002eu-Of for emacs-devel@gnu.org; Sun, 30 Jun 2024 16:15:51 -0400 Original-Received: from mail-4322.protonmail.ch ([185.70.43.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sO0xe-0002mC-Ir; Sun, 30 Jun 2024 16:15:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1719778541; x=1720037741; bh=8eIE1WMIWrg4Bp7hgaH2sjA92giLlKoH/1KoH9XytZY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ltn8tDQYy0z8MAs3/8Hpttc5Z+CseuCDv2HZKp73IZCXp25+/xIZqHl9UEAXBfJ9l TOMBodWnwvjhWdlRCa6DExZjRRHAbMJcEt76/uCtYwJHu3Ghvu9q90XjW/2tgTxLJh PVqVBUgnYEXxAm5Wqpqlcd3s7geBNHEnv+OKq4uOsUGRXWXH3B44bojzmIzUoZDVu5 YRvJzCB4xBE093rps28OYgbnln2B7elbZg5ciAFfvjbZ8c6A9IFta0n2xBqnLVlhIt wZ5lK7aKdTgMkkDNvraWYQKaGthWmhlM654aVmNoDH0sTXePrq2KWuZB+bAKNByOsQ 64KKnMQakCv4w== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: e342917516ae855eb3da0d7b2493bd9b12652e8f Received-SPF: pass client-ip=185.70.43.22; envelope-from=pipcet@protonmail.com; helo=mail-4322.protonmail.ch 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, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 30 Jun 2024 22:19:06 -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:320992 Archived-At: This is a multi-part message in MIME format. --b1_SWks5owKwq4drGdL38tuSA69EjYBFu22XTj169Sw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sunday, June 30th, 2024 at 19:22, Gerd M=C3=B6llmann wrote: > Thanks! What do youo think about making a patch containing only your > weak hash tables, and leaving the BUF_MARKERS alone for now? I think that's the best way forward. Patch attached. > That way > igc could support the existing uses of weak hash tables (I remember one > in the CLOS department somehwere), and they would be somewhat tested. > Don't remember if we have unit tests for them. It seems MPS isn't very eager about splatting weak references during ordina= ry automatic GC, FWIW. What I'm observing with (while t (dotimes (i 10000) (puthash (cons 1 2) (cons 3 4) table)) (message "%S" (hash-table-count table)) (sit-for 0.1)) is that the hash table starts out at 0, grows quickly, resets to count=3D0 = once, then keeps growing and never splats any references after that. It's q= uite possible this is a bug in my code, of course. Pip --b1_SWks5owKwq4drGdL38tuSA69EjYBFu22XTj169Sw Content-Type: text/x-patch; name=0003-mps-weak-hash-tables.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0003-mps-weak-hash-tables.patch ZGlmZiAtLWdpdCBhL3NyYy9hbGxvYy5jIGIvc3JjL2FsbG9jLmMKaW5kZXggMDliNTFiYTJhMDgu LjVkNDdkM2Y3ODUxIDEwMDY0NAotLS0gYS9zcmMvYWxsb2MuYworKysgYi9zcmMvYWxsb2MuYwpA QCAtNjIzMCw2ICs2MjMwLDE2IEBAIHB1cmVjb3B5IChMaXNwX09iamVjdCBvYmop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b3QgKGgsIGksIGkg PCBzaXplIC0gMSA/IGkgKyAxIDogLTEpOworCSAgc2V0X3dlYWtfaGFzaF9rZXlfc2xvdCAoaCwg aSwgSEFTSF9VTlVTRURfRU5UUllfS0VZKTsKKwkgIHNldF93ZWFrX2hhc2hfdmFsdWVfc2xvdCAo aCwgaSwgUW5pbCk7CisJfQorCisgICAgICBwdHJkaWZmX3QgaW5kZXhfc2l6ZSA9IHdlYWtfaGFz aF90YWJsZV9pbmRleF9zaXplIChoKTsKKyAgICAgIGZvciAocHRyZGlmZl90IGkgPSAwOyBpIDwg aW5kZXhfc2l6ZTsgaSsrKQorCWgtPnN0cm9uZy0+aW5kZXhbaV0ubGlzcF9vYmplY3QgPSBtYWtl X2ZpeG51bSAoLTEpOworCisgICAgICBoLT5zdHJvbmctPm5leHRfZnJlZSA9IG1ha2VfZml4bnVt ICgwKTsKKyAgICAgIGgtPnN0cm9uZy0+Y291bnQgPSBtYWtlX2ZpeG51bSAoMCk7CisgICAgfQor fQorCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqCiAJCQkgICBXZWFrIEhhc2ggVGFibGVzCkBAIC01OTIw LDYgKzYyODYsMTEgQEAgREVGVU4gKCJoYXNoLXRhYmxlLWNvdW50IiwgRmhhc2hfdGFibGVfY291 bnQsIFNoYXNoX3RhYmxlX2NvdW50LCAxLCAxLCAwLAogICAgICAgIGRvYzogLyogUmV0dXJuIHRo ZSBudW1iZXIgb2YgZWxlbWVudHMgaW4gVEFCTEUuICAqLykKICAgKExpc3BfT2JqZWN0IHRhYmxl KQogeworICBzdHJ1Y3QgTGlzcF9XZWFrX0hhc2hfVGFibGUgKndoID0gY2hlY2tfbWF5YmVfd2Vh a19oYXNoX3RhYmxlICh0YWJsZSk7CisgIGlmICh3aCkKKyAgICB7CisgICAgICByZXR1cm4gd2gt PnN0cm9uZy0+Y291bnQ7CisgICAgfQogICBzdHJ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Aoc2l6ZSA8IFhGSVhOVU0gKGgtPnN0cm9uZy0+Y291bnQpKSwKKwkJICB9 KTsKKwkgICAgICB9CisJICAgIGVsc2UKKwkgICAgICB7CisJCS8qIEVtcHR5IHRhYmxlOiB3ZSBj YW4gb21pdCB0aGUgZGF0YSBlbnRpcmVseS4gICovCisJCXByaW50Y2hhciAoJyknLCBwcmludGNo YXJmdW4pOworCQktLXByaW50X2RlcHRoOyAgIC8qIERvbmUgd2l0aCB0aGlzLiAgKi8KKwkgICAg ICB9CisJICAgIGdvdG8gbmV4dF9vYmo7CisJICB9CisKIAljYXNlIFBWRUNfQklHTlVNOgogCSAg cHJpbnRfYmlnbnVtIChvYmosIHByaW50Y2hhcmZ1bik7CiAJICBicmVhazsK --b1_SWks5owKwq4drGdL38tuSA69EjYBFu22XTj169Sw--