
27 Aug
2007
27 Aug
'07
1:45 p.m.
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.