[v3] mt_allocator performance improvements

David Boreham david_list@boreham.org
Thu Mar 16 21:40:00 GMT 2006


>>>
>>>
>>> Then, we have a problem, a serious one. Because 
>>> __block->_M_thread_id in general is != __thread_id. In other terms, 
>>> we are *not* preserving semantics. Do you agree?
>>
>>
>> Yes. This is a bug.
>
>
So Scott took a look at this. He said:

----------------------

>
>      // Return this block to our list and update counters and
>      // owner id as needed.
> -    --__bin._M_used[__block->_M_thread_id];
> +    --__thread_bin._M_used;
>    


Changed that line to:
--_M_thread_bin[__block->_M_thread_id][__which]._M_used;

This should have the desired effect. I ran 'make check' and had the same 
results as before.

---------------------







More information about the Libstdc++ mailing list