Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
in thread-local meta, iterate snapshot of atomic-grow-array
Summary: Iterate a snapshot of the id-to-thread-entry-set-map rather than iterating the map directly. Iterating a snapshot can avoid some extra loads and branches on every index being iterated as compared with iterating the map directly. A snapshot of an atomic-grow-array is always valid until the array is destroyed. The typical way to iterate `atomic_grow_array` is to iterate a snapshot gotten via member `as_view`. This works when there is no externally-known array size, since the array does not internally track any actual size or other information about elements that have already been accessed. But in `StaticMeta` we do track an upper bound on elements that have already been accessed, so we may use `as_ptr_span` and then `subspan` on that. Differential Revision: D66744595 fbshipit-source-id: 93f1d9693d998fb2c236594ac69f390f8c8bf0c5
- Loading branch information