zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: 5.8: LTO exposes some new issues
Date: Tue, 28 Jul 2020 09:25:24 +0100 (BST)	[thread overview]
Message-ID: <727383568.664238.1595924724485@mail2.virginmedia.com> (raw)
In-Reply-To: <20200728075343.2cfb1ebf@tarpaulin.shahaf.local2>

> On 28 July 2020 at 08:53 Daniel Shahaf <d.s@daniel.shahaf.name> 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

  reply	other threads:[~2020-07-28  8:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 23:41 Tomasz Kłoczko
2020-07-22  5:59 ` Daniel Shahaf
2020-07-25 17:43   ` Bart Schaefer
     [not found]     ` <CABB28CxSD5w-SY-iCVYuQ4kJfBpNJOWhpk4HOrS1DNPfMVztgw@mail.gmail.com>
2020-07-25 20:05       ` Fwd: " Bart Schaefer
2020-07-27  2:12         ` Daniel Shahaf
2020-07-27 10:07           ` Tomasz Kłoczko
2020-07-27 11:09             ` Roman Perepelitsa
2020-07-27 12:19               ` Roman Perepelitsa
2020-07-27 12:46                 ` Tomasz Kłoczko
2020-07-27 14:13                   ` Roman Perepelitsa
2020-07-27 14:19                   ` Roman Perepelitsa
2020-07-28  8:09                     ` Daniel Shahaf
2020-07-28 10:55                     ` Fwd: " Roman Perepelitsa
2020-07-28  8:19                   ` Daniel Shahaf
2020-07-28  7:53                 ` Daniel Shahaf
2020-07-28  8:25                   ` Peter Stephenson [this message]
2020-07-28 10:52                     ` Roman Perepelitsa
2020-07-28 11:19                       ` Daniel Shahaf
2020-07-28 11:31                         ` Roman Perepelitsa
2020-07-28 11:51                           ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=727383568.664238.1595924724485@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).