Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:117649 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 28860 invoked from network); 29 Apr 2022 14:48:12 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Apr 2022 14:48:12 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AD545180054 for ; Fri, 29 Apr 2022 09:24:13 -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=3.3 required=5.0 tests=BAYES_50, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, PDS_OTHER_BAD_TLD,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-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 29 Apr 2022 09:24:10 -0700 (PDT) Received: by mail-lf1-f49.google.com with SMTP id x33so15001136lfu.1 for ; Fri, 29 Apr 2022 09:24:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=e70O9k5MGOnQkhP+weUb8RAh1EQAU5YrImXXGTOLCyQ=; b=L7H9g4GjMEfyM6eMx6y5trICAuk8eEsIzhT2DFOobXvjtRWhVWo7KoCqrNY2lF962S d5aQolnZYaz/n7J+OXvppDL98QbvngusUFGY+vaO/IENzqWnkcI6fmoC1pxFvng+SeXF H5TbMpfdJ5RWj4v70UjIlb7Pl2qOD+VMRI5rfZ27y769Zs9wong1Gfc/I9ypi5f3xKqf FL8UDeJ/0SOkvKJCZ6WN3kUp/q2HFtOMfEIdfMGakT2UIFyrEmttRkq/QkLDd9dEFebe UEx/mV5tYmHVJ57jKOWob6maMHL0rw/mn2yMkFun9/g5rFEKY/asBymOSzvRBH2Wzfev 3+sA== X-Gm-Message-State: AOAM533Ui7jAHp7sef41CZu075iFl0qUv3YNY7q1VVZeg0RU6Ddd9rM1 e3O53Q4gzcVXTz+vWzkuewafpQSzhzPUmP+jT26DlwYq9vs= X-Google-Smtp-Source: ABdhPJxh+P98TIjg1Kv39nZ2Fk+OmWAFuJSkfhv7HdplPTED5rJ7jlEhea5bc9J3UbMWEKlQ3XezJP5pt19kMECPC6U= X-Received: by 2002:ac2:4250:0:b0:44a:ff88:3795 with SMTP id m16-20020ac24250000000b0044aff883795mr15269lfl.384.1651249448336; Fri, 29 Apr 2022 09:24:08 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 29 Apr 2022 10:23:52 -0600 Message-ID: To: internals Content-Type: text/plain; charset="UTF-8" Subject: Questions on history of zend_module_entry From: levim@php.net (Levi Morrison) Hello, for two separate reasons I was recently reviewing zend_module_entry's layout and usage and there are two things I don't understand: 1. Why does zend_module_entry have a `.size` member, if it's not actually used anywhere as far as I can tell from both reading code and setting debugger watchpoints? One place it probably _ought_ to be used is when we copy the module entry in `zend_register_module_ex` (https://heap.space/xref/php-src/Zend/zend_API.c?r=733023b2#2381), but `sizeof(zend_module_entry)` is used instead. 2. Why do we copy the module entry in `zend_register_module_ex` anyway? I've dug through git history a bit but haven't found anything notable so far. It seems like we should store the parameter and document it needing to have a static lifetime (or a heap-allocated lifetime which just leaks), which would satisfy both get_module() and the hybrid extension/zend_extension hacks. In any case, the particular combination of these two points makes it seem like something is broken, wrong, or obsolete and needs to be documented as such. I am hoping someone here knows the history or background on this!