Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: type-checking for metafiedness? (was: Re: Cores almost on demand in patcompile())
- X-seq: zsh-workers 39637
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: type-checking for metafiedness? (was: Re: Cores almost on demand in patcompile())
- Date: Fri, 14 Oct 2016 17:53:17 +0100
- Cms-type: 201P
- In-reply-to: <20161014063625.GC11115@fujitsu.shahaf.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CAKc7PVBEjPJMtV59CrN6LmrDaoGqfa_DZqwo3Y9HK=+0od7ycA@mail.gmail.com> <CAKc7PVCAR2yTJGgdBbvTp=mBC0ZrXcVWW0DE_U26TezSTNdd=A@mail.gmail.com> <CAKc7PVB=485r3nRz_pP3A-k-oq2pOp5qYUK7pE1VEApXb0pR1g@mail.gmail.com> <CAKc7PVDof_GEuoSv7pg8c1=spXfDkWopP5VR8dVHg-bxXVES1g@mail.gmail.com> <CAKc7PVCRtBBVONgiExopYYUv7x4-HN_QEYk-05aoqZihiCRgMw@mail.gmail.com> <CAH+w=7a7jc0Q2=M9aG5mttbazxfsHB-Cz=WwJzCvz_SdnbApRw@mail.gmail.com> <CGME20161011065321eucas1p22afaabbe1f17f26a1b3507619ed1d96f@eucas1p2.samsung.com> <20161011065105.GB16819@fujitsu.shahaf.local2> <20161013112251.329c0dbf@pwslap01u.europe.root.pri> <CAH+w=7ZArSYVkjcrbAmkeiWsmpiufbj9+DeNhORgKtYEXEkn7Q@mail.gmail.com> <20161014063625.GC11115@fujitsu.shahaf.local2>
On Fri, 14 Oct 2016 06:36:25 +0000
Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> A 'char **' would become a 'struct metafied_t *', i.e., an array of
> structs. This is not equivalent: the array stride of the latter may be
> larger than the array stride of the former.¹ However, this would only
> be a problem if the code makes assumptions about where elements are
> allocated relative to each other, e.g., if the code assumes that
> «ary[1] - ary[0] == 1+strlen(ary[0])» or otherwise uses the values of
> ary[N] and ary[M] in a single expression.
>
> Does the code make such assumptions?
No, char ** is used fairly generically.
I don't think arrays of unmetafied strings are that common, and in at
least one case (the print builtin) having the length as part of the
unmetafied_t structure, avoiding a parallel length structure, is
beneficial.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author