From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27157 invoked from network); 28 Jul 2020 08:26:09 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2020 08:26:09 -0000 Received: (qmail 5405 invoked by alias); 28 Jul 2020 08:26:04 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: Sender: zsh-workers@zsh.org X-Seq: 46274 Received: (qmail 13908 invoked by uid 1010); 28 Jul 2020 08:26:04 -0000 X-Qmail-Scanner-Diagnostics: from smtpq2.tb.ukmail.iss.as9143.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25884. spamassassin: 3.4.4. Clear:RC:0(212.54.57.97):SA:0(-2.7/5.0):. Processed in 1.076259 secs); 28 Jul 2020 08:26:04 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _mailcloud.virginmedia.com designates 212.54.57.97 as permitted sender) X-Env-Mailfrom: p.w.stephenson@ntlworld.com X-Env-Rcptto: zsh-workers@zsh.org X-SourceIP: 172.25.160.143 X-CNFS-Analysis: v=2.3 cv=QNPzujDL c=1 sm=1 tr=0 a=pVlFXI3Q25jgZXAaIqG4JA==:117 a=KEnZaF_ea6UA:10 a=IkcTkHD0fZMA:10 a=DoY9bV0jb9AA:10 a=xXbdT-AvmqQr5J8VvHkA:9 a=QEXdDO2ut3YA:10 X-Authenticated-Sender: p.w.stephenson@ntlworld.com Date: Tue, 28 Jul 2020 09:25:24 +0100 (BST) From: Peter Stephenson To: Zsh hackers list Message-ID: <727383568.664238.1595924724485@mail2.virginmedia.com> In-Reply-To: <20200728075343.2cfb1ebf@tarpaulin.shahaf.local2> References: <35bf1c7b-163f-4baf-9d5a-c1d7e72459ec@www.fastmail.com> <20200728075343.2cfb1ebf@tarpaulin.shahaf.local2> Subject: Re: 5.8: LTO exposes some new issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev72 X-Originating-IP: 165.225.81.56 X-Originating-Client: open-xchange-appsuite X-CMAE-Envelope: MS4wfHd6KZydMzwhWpMLvFJFY4q9YKdpTSZgUEfevxdvf2A9aN0ebG29lo6JPX4N/BZIRqW2xTZESi/2upqEL1juTXsmB+sMGoFXdlfa5oqINKPDsnWXwAqv lsR99kfHaJ0YtIPCmSNrrZhqWh0gB8z+LOXm3I1hbpyZse7duKbsPBCpWFUxyE1BlEeNCSTw9rZjGm0TIz6SY8e3b78orV8zV08= > On 28 July 2020 at 08:53 Daniel Shahaf wrote: > Roman Perepelitsa wrote on Mon, 27 Jul 2020 14:19 +0200: > > +++ b/Src/zsh.h > > @@ -1205,9 +1207,15 @@ struct hashtable { > > -#ifdef HASHTABLE_INTERNAL_MEMBERS > > - HASHTABLE_INTERNAL_MEMBERS /* internal use in hashtable.c */ > > -#endif > > + /* HASHTABLE INTERNAL MEMBERS */ > > + ScanStatus scan; /* status of a scan over this hashtable */ > > + > > +#ifdef ZSH_HASH_DEBUG > > + /* Members of struct hashtable used for debugging hash tables */ \ > > + HashTable next, last; /* linked list of all hash tables */ \ > > + char *tablename; /* string containing name of the hash table */ \ > > + PrintTableStats printinfo; /* pointer to function to print table stats */ > > +#endif /* !ZSH_HASH_DEBUG */ > > }; > > Thanks for looking into this. > > It's clearly correct, but as written, the patch loses the distinction > that these members are private to hashtable.c and should not be accessed > by other parts of the code. Could you address that, please? If > there's an easy way to have the compiler enforce this restriction, > great; else, we can at least add a comment. One way is to have a "struct { ... } private" substructure, which it makes it clear what's going on within the code (though comments are obviously useful, too). pws