Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120765 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 87558 invoked from network); 7 Jul 2023 16:20:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 7 Jul 2023 16:20:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 141931804F5 for ; Fri, 7 Jul 2023 09:20:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 7 Jul 2023 09:20:37 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-31441bc0092so2040710f8f.1 for ; Fri, 07 Jul 2023 09:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688746836; x=1691338836; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=JRkGcZlGJRVWgRF5bluuzdqWplrrTjAflN07njbxj4A=; b=kTvs2qhb2yizMHkQ5UB2rBAX710mNP1BYBhT18ff25pSwPPUDxRbYXOGPLHSUntfWj 7pIk6HmuW8fxJZ+apmPICkZ9CIbkntOv4VPRPV0s7C2fEIJfrmqYwB+ggep1vXkenBGx 76pr+vdrk3zkAUe2MdyJhC10pwwNt3KvlK+MpbsPVGf654Pb+oDolDc/FWg7YxNP+D8l 0UGXdEhjDFQSOl9/ca5TL7TDW9Z0/SbU4LfO8XF1wN/Iwq4aeedcLW4winjfdGkVC8+B WYgjXEAiEAVD8+U5HCsaRuUp6v00U5sKbZ3mXheEc7ziOIjMisQz+QM2SO1s3h5Aq0YF ctaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688746836; x=1691338836; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JRkGcZlGJRVWgRF5bluuzdqWplrrTjAflN07njbxj4A=; b=GgvopWh4oKaTJgPoDjE2o3cOiX04HILWs9Zx8lsm5xxpngzOBpWXdYTsIO30bkP53C LLcxTJ6uHp8VhIyRH6VcTOVLxPoaKIhcxJ0OLDmjuJ3TRCGRPn2b7smnDG658bUGQ2hz xe6zHxAzEBx16kluHWzzgVFd41/Zz7ICSN0d3+tN1Sxgopkkwl3F/Au4TFSyz/GC9qv7 1XD83aNgQBupRimDdUA1GJejWMSmU5ert0+4QjVkA4Q1ufbg4GNpKJ8ccfUEr5pmW3Oh KUD7rScmUiBCN6syVvkdXyUWjD1MyTQuFpeJI458QKRM7Xw3WvpabiKf15XuxCVC82yN 0HhQ== X-Gm-Message-State: ABy/qLYO/NtGxlY8vYkiBFhNfOOS5M3IrF2KNmlljKTHuciybAm3jn7+ ClBqczERtlc4XFp12oKVjCO/WZ8FkmREYhn6kiqjNrYnPfjZ1w== X-Google-Smtp-Source: APBJJlEjGFupi/Ef14r/j2uXaic6FRUQ3atL29HpFcaKPOZuQa+WjfsrtbV/Dr8U0oskBb/9Z66FSK1LozrI1rJtSp4= X-Received: by 2002:adf:e94e:0:b0:313:f6bb:ec2b with SMTP id m14-20020adfe94e000000b00313f6bbec2bmr4509068wrn.47.1688746835849; Fri, 07 Jul 2023 09:20:35 -0700 (PDT) MIME-Version: 1.0 References: <4c16c652-a718-45e6-a77a-74654a6761e7@app.fastmail.com> In-Reply-To: <4c16c652-a718-45e6-a77a-74654a6761e7@app.fastmail.com> Date: Fri, 7 Jul 2023 18:20:24 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] New gc_status() fields, and WeakMap cycle collection From: arnaud.lb@gmail.com (Arnaud Le Blanc) I agree that we may not consider this a BC break, but I'm asking in case people rely on the current behavior or if the change is more controversial than I thought. To be fair they work as specified in the RFC, and are actually weak as they do not explicitly retain their keys, but they need explicit support from the GC to be able to collect some types of cycles. WeakMap implementations based on WeakReferences tend to have this limitation. For instance, the Java documentation for WeakHashMap has this warning: "The value objects in a WeakHashMap are held by ordinary strong references. Thus care should be taken to ensure that value objects do not strongly refer to their own keys, either directly or indirectly, since that will prevent the keys from being discarded". On Fri, Jul 7, 2023 at 4:03=E2=80=AFPM Larry Garfield wrote: > > On Fri, Jul 7, 2023, at 1:09 PM, Arnaud Le Blanc wrote: > > Hi everyone, > > > > I'm considering merging the following two PRs: > > > > https://github.com/php/php-src/pull/11523: Exposes the time spent in > > the cycle collector via new gc_status() fields. > > https://github.com/php/php-src/pull/10932: Allows the GC to collect > > certain types of cycles involving WeakMaps. > > > > The second one introduces a minor BC break. > > > > If there are no objections, I plan to merge these PRs prior to the > > feature freeze. > > > > Best regards, > > Arnaud > > For the second, doesn't that translate to "WeakMaps are currently not act= ually Weak, and thus don't work at all?" I don't quite know how that would= be a BC break to fix... > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >