X-Git-Url: http://plrg.eecs.uci.edu/git/?p=junction.git;a=blobdiff_plain;f=junction%2FConcurrentMap_Leapfrog.h;h=3a8493e62d18ec979cc4f2d26038d470cb0814f3;hp=89ba120d435ff0738291a8318364eb9a0165de67;hb=67553e4e9f491e31e92a0ccd2967eb34b0c6f206;hpb=ebd740423cce85a1d1049f637d4e65b7d8465717 diff --git a/junction/ConcurrentMap_Leapfrog.h b/junction/ConcurrentMap_Leapfrog.h index 89ba120..3a8493e 100644 --- a/junction/ConcurrentMap_Leapfrog.h +++ b/junction/ConcurrentMap_Leapfrog.h @@ -114,6 +114,12 @@ public: return; // Found an existing value } case Details::InsertResult_Overflow: { + // Unlike ConcurrentMap_Linear, we don't need to keep track of & pass a "mustDouble" flag. + // Passing overflowIdx is sufficient to prevent an infinite loop here. + // It defines the start of the range of cells to check while estimating total cells in use. + // After the first migration, deleted keys are purged, so if we hit this line during the + // second loop iteration, every cell in the range will be in use, thus the estimate will be 100%. + // (Concurrent deletes could result in further iterations, but it will eventually settle.) Details::beginTableMigration(m_map, m_table, overflowIdx); break; }