apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bri...@apache.org>
Subject Re: more notes on the apr_time_t issue
Date Mon, 15 Jul 2002 05:09:02 GMT
William A. Rowe, Jr. wrote:

> At 11:41 PM 7/14/2002, Ryan Bloom wrote:
>
>> >
>> > I'd suggest you snooze, you lose, but of course this is only two 
>> weeks old,
>> > not two years old.
>>
>> I am going to ignore this flame bait.
>
>
> Not flame bait... reminder to myself that this is brand new code...
> ...there are plenty of folks who don't even check their mail for two
> weeks on vacation.
>
> Point is; the existing helper macros are up for discussion.  We can
> pull them back out [don't scream, bpane!] if someone objects loudly.


I have strong reservations about removing the helper macros,
but not because of how long it will take to change the code.

Once we go to binary microseconds, the idiom for
extracting microseconds from an apr_[whatever_a_time_is_called]_t
will be:
    t & 0xfffff
or
    t % 0x100000
Even with #defines for those constants, I anticipate
that people will get the code wrong a lot--using '&'
where there ought to be '%', for example.

The macros make it really hard to make such mistakes.

--Brian

P.S.: I suspect that we'll always have to use "t & mask" instead
of "t % constant," given the recent discussions about how some
32-bit compilers don't strength-reduce the modulo to a bitwise
AND when optimizing 64-bit code.



Mime
View raw message