A nice optimisation provided by bytemuck is the ability to do zeroed heap allocations using calloc safely. Since the default parking_lot Mutex and RwLock have an all-zeroes default state, then this means for any safely zeroable type T, RwLock<T> and Mutex<T> are also safely zeroable - and, by extension, FairMutex too. ReentrantMutex is not, however. Implementing these traits - even if behind a feature gate - would make some use-cases using collections of mutexes faster.
A nice optimisation provided by
bytemuckis the ability to do zeroed heap allocations usingcallocsafely. Since the defaultparking_lotMutexandRwLockhave an all-zeroes default state, then this means for any safely zeroable typeT,RwLock<T>andMutex<T>are also safely zeroable - and, by extension,FairMutextoo.ReentrantMutexis not, however. Implementing these traits - even if behind a feature gate - would make some use-cases using collections of mutexes faster.