This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug mode performance patch


On 18 November 2010 21:36, Paolo Carlini wrote:
> Hi,
>
>> Is there a problem if I simply always use unsigned long long ?
>
> If I remember well your specific case, probably not. By the way, did you consider hashing the address (by _Hash_bytes, like in <typeinfo>)?

I thought about suggesting that too. François's improved get_mutex
function only uses the lowest few bits, and I don't know how well
Hash_bytes works if you don't use the whole value ... probably still
better distributed than simply taking the address, and might avoid
pathological cases where distinct pairs of objects always get the same
two mutexes.

Without doing some tests I don't know, so using unsigned long long is
an improvement over just unsigned long.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]