On 4/7/21 4:00 AM, Marc Nieper-Wißkirchen wrote:

That's why I am wondering whether it makes sense to have an xsize module
that uses idx_t instead of size_t.

It might, yes. I use intprops.h for this sort of thing, but perhaps a stripped-down header would be appropriate.

I am planning to make xalloc.h use idx_t rather than size_t for object and byte counts, as we really should be using signed integers there, for all the usual reasons. So in some sense I want xsize's current API to be obsolete.

   assure (i < n);
   assure (0 <= i);

I suggest writing 'assure (0 <= i && i < n);' as it's easier to read, at least for me. Better yet, use 'affirm' rather than 'assure' as this helps the compiler generate better code.

Reply via email to