You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Justin Erenkrantz <je...@apache.org> on 2003/01/13 20:18:42 UTC

Re: cvs commit: apr/include apr_hash.h

--On Monday, January 13, 2003 6:52 PM +0000 wrowe@apache.org wrote:

> wrowe       2003/01/13 10:52:07
>
>   Modified:    tables   apr_hash.c
>                include  apr_hash.h
>   Log:
>     A binary-safe patch that satisfies Jerenkrantz's original
> desire for     more elements, but structured such that we still use
> the optimal platform     element indexes (a machine int is
> generally faster than a fractional int).

Um, apr_uint32_t is unsigned int.  Actually, I wonder what would 
happen when sizeof(int) isn't 4 on a Unix system.  APR's configure 
would produce an invalid apr.h.

It also seems to be common to use apr_uint32_t for indexes (see 
apr_allocator.h).  -- justin

Re: cvs commit: apr/include apr_hash.h

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 01:18 PM 1/13/2003, Justin Erenkrantz wrote:
>--On Monday, January 13, 2003 6:52 PM +0000 wrowe@apache.org wrote:
>
>>wrowe       2003/01/13 10:52:07
>>
>>  Modified:    tables   apr_hash.c
>>               include  apr_hash.h
>>  Log:
>>    A binary-safe patch that satisfies Jerenkrantz's original
>>desire for     more elements, but structured such that we still use
>>the optimal platform     element indexes (a machine int is
>>generally faster than a fractional int).
>
>Um, apr_uint32_t is unsigned int.

Which is why the patch transformed them into unsigned int's... the size
remains the same on 64 bit CPUs, and since sizeof(int) == sizeof(unsigned int)
we shouldn't have problems with older builds.

>  Actually, I wonder what would happen when sizeof(int) isn't 4 on a Unix system.  APR's configure would produce an invalid apr.h.

How do you mean?  Are unicies 64 LP architectures?  I'm fairly certain we
can find 64 ILP architectures, so we better use caution here.

>It also seems to be common to use apr_uint32_t for indexes (see apr_allocator.h).  -- justin

Irrelevant, we didn't change that size after we incorporated it, so choosing
apr_unit32_t didn't harm anything.  Those are private values.  For performance 
reasons perhaps we should change it to unsigned int in APR 1.0, but that's 
something to chew on for the future, not for the 0.9 branch.

Bill