randomize folly::dynamic and most F14 map and set insert order in debug builds
Summary: It's easy to accidentally rely on the relationship between insert and iteration order in unordered containers. This diff adds some randomization to the insertion order within an F14 chunk when compiled in debug mode. This isn't full randomization of the order, but is enough to break tests that rely on the iteration order of F14 maps and sets as small as two elements. This diff applies randomization to folly::dynamic object, F14NodeSet, F14NodeMap, F14ValueSet, F14ValueMap, F14FastSet for small (< 24 bytes) value_type, and F14FastSet for small value_type. The long-term plan is to randomize insertion order for all F14FastSet and F14FastMap, leaving iteration order deterministic only for explicit uses of F14VectorSet and F14VectorMap. Reviewed By: yfeldblum Differential Revision: D13099681 fbshipit-source-id: 35b3174a8afbc6cef27d2080adc5a01e85154dcd
Showing
Please register or sign in to comment