stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: svn commit: r465512 - /incubator/stdcxx/trunk/include/
Date Fri, 03 Nov 2006 01:14:25 GMT
Martin Sebor wrote:
> wrote:
>> Author: faridz
>> Date: Wed Oct 18 23:53:06 2006
>> New Revision: 465512
>> URL:
>> Log:
>> 2006-10-19 Farid Zaripov <>
>>     STDCXX-297
>>     * (__rw_bitset): Corrected calculation of
>>     size of the __bits buffer
> I think the logic should be factored out into a function,
> say __rw_bits_to_bytes, defined in bitset.cpp.

Or maybe even __rw_bit_clear since, AFAICS, the only thing
the computed value is used for is a call to memset().

Another option would be to change __rw_shl() (as well as
__rw_shr()) to take the number of bits rather than bytes
as their second argument and have them do the computation.
Then we could call __rw_shl() (or __rw_shr()) to quickly
set all the bits to zero by shifting the bitset more than
the number of bits it contains.


> That will
> allow us to reduce the complexity of the code here (making
> it smaller and faster to compile) while at the same time
> letting us reuse the same logic in the char and wchar_t
> overloads defined in bitset.cpp.
> Martin

View raw message