Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2007-08-27 09:45:24


Howard Hinnant:

> On Aug 21, 2007, at 5:14 PM, Peter Dimov wrote:
>
>> void __cndcheck_init( void * pc, void * pm )
>> {
>> __cndcheck_state[ (size_t)pc % 17041 ] = { pc, pm }; // atomic
>> store
>> }
>
> So what do you do about collisions?

Nothing; if there's a collision, I miss the opportunity to check. The
"permissive" spec allows me to do that. If I had to throw on mutex mismatch,
this implementation would be non-conforming. I can tune the magic number
17041 to strike the best ratio of accuracy vs space, and I can vary it
slightly on each run to redistribute the collisions.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk