On Fri, Jul 01, 2022 at 06:47:48PM +0200, Aldy Hernandez wrote: > > So, you are looking for something like trailing_wide_ints<N> but where that > > N is actually a runtime value? Then e.g. the > > struct {unsigned char len;} m_len[N]; > > member can't work properly either, because it isn't constant size. > > What my patch does is store the run-time length in the aforementioned > byte, while defaulting to N/MAX. There is no size difference (or code > changes) for existing users. With my change, set_precision() and > extra_size() now take a runtime parameter, but it defaults to N and is > inlined, so there is no penalty for existing users. I benchmarked to > make sure :).
So, you still use N = 3 but can sometimes store say 255 wide_ints in there? In that case, m_len[N] provides lengths just for the first 3, no? Anyway, you really want feedback from Richard Sandiford IMHO... Jakub