safe unordered local iterators
Jonathan Wakely
jwakely.gcc@gmail.com
Sat Jul 9 10:19:00 GMT 2011
On 8 July 2011 21:44, François Dumont wrote:
> Hi
>
> No feedback on this proposition ?
I did look over the patch, but not very thorougly. I didn't see any
problems but will try to give it the time it deserves in the near
future. Sorry for the lack of feedback.
> Don't you think that there are any interest in tracking unordered
> containers local iterators ?
Yes, if it's possible for users to invalidate and misuse those
iterators then it's a good idea to have debug mode checks.
> I just would like to pass this patch before the C++ 0x ABI gets frozen
> which might happen soon as the new Standard is going to be released.
>
> François
>
>
> On 07/03/2011 10:18 PM, François Dumont wrote:
>>
>> Hi
>>
>> This is a proposition of patch to correctly handle the unordered
>> containers local iterators. This patch adds tracking of the local iterator
>> instances and detection of invalid usage like for the other kind of
>> iterators. I have added a small test case to show what kind of invalid usage
>> libstdc++ will be able to detect with this patch. For a number of questions
>> I haven't found the answer in the standard draft, maybe I haven't looked for
>> it enough, I hope you will be able to help:
>>
>> - In safe mode I consider as invalid comparison of local iterators from
>> different buckets, is it ok ?
>> - When the unordered container is rehashed I invalidate all local
>> iterators except local end iterators, whatever bucket they come from. This
>> is so because local end iterators are container independant, they simply
>> point to a null node. They are kept valid even if after the rehashed
>> operation the bucket origin is greater than the new bucket count. Do you
>> think it is ok ?
>> - Regarding exports, I have exported only what will normally be used from
>> user code and not all methods implemented in src/debug.cc file. I wonder if,
>> thanks to some inlinement at link time, other symbols shouldn't be exported
>> too. Should I export all symbols implemented in src/debug.cc ?
>>
>> Thanks for your help.
>>
>> Regards
>>
>> François
>>
>>
>>
>
>
More information about the Libstdc++
mailing list