Use F14FastMap with SharedMutex for profiles
Summary:
Maps contained within the LoggingProfiles and SinkProfiles are converted to F14FastMaps with a mutex for synchronization. Because iterators are only invalidated upon insertion/deletion, we hold a reader lock when modifying values and a writer lock when inserting values.
We also introduce a wrapper around std::atomic called CopyAtomic. Containers without node indirection require their value types to be either move or copy constructible in order to support resizing operations. std::atomic does not offer these constructors due to atomicity concerns. As we guarantee that resizing operations are synchronized wrt holding the write mutex, we provide such copy constructors for the atomic value.
Differential Revision:
D25223031
fbshipit-source-id:
8eddb31468d55999915c30fba921a9909006432c