[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 185 - trunk/subversion/libsvn_delta

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2001-10-01 14:14:22 CEST

> Um... no. "i" represents a bucket or slot number. It is not a memory
> size, so it shouldn't be an apr_size_t.

Hm.

First, I observe that the range of a bucket or slot number is the same
as the range of the number of buckets or slots in an array. So,
apr_size_t would be an appropriate type for an index into a string,
for instance, even though it is not a "memory size"; the range is the
same.

I also observe that, for instance, fwrite() uses a size_t to describe
the nmemb field, which is a number of "buckets" rather than a number
of bytes. There is no other type guaranteed to hold the range of
values describing the number of buckets or slots in an array.

In practice, of course, an int or unsigned int is unlikely to ever
cause us problems (I doubt we'll be troubled with 16-bit int
platforms). But I'm not sure there's any reason to object in theory
to using apr_size_t for these values.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:43 2006

This is an archived mail posted to the Subversion Dev mailing list.